Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Eadmin Laravel Package

aequation/eadmin

Symfony bundle extending EasyAdmin with AEQUATION enhancements. Adds extra tooling and integrations to customize and streamline your admin backend, with improved configuration options and features on top of EasyAdmin.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require aequation/eadmin
    

    Ensure your project uses Symfony 5.4+ and EasyAdmin 4.x.

  2. Enable the Bundle Add to config/bundles.php:

    Aequation\EAdminBundle\AequationEAdminBundle::class => ['all' => true],
    
  3. First Use Case Extend an existing EasyAdmin CRUD controller to leverage custom features:

    use Aequation\EAdminBundle\Controller\AdminController;
    
    class CustomPostCrudController extends AdminController
    {
        // Inherit custom admin panel features
    }
    
  4. Key Files to Review

    • src/Resources/config/services.yaml (for autowiring)
    • src/Controller/AdminController.php (base class)
    • README.md (for bundle-specific features like bulk actions or UI tweaks).

Implementation Patterns

1. Extending EasyAdmin CRUD

Use the provided AdminController as a base class to inherit:

  • Custom bulk actions (e.g., export, soft-delete).
  • Pre-configured UI components (e.g., inline editing, custom filters).
  • Example:
    class PostCrudController extends AdminController
    {
        public static function getEntityFqcn(): string
        {
            return Post::class;
        }
    
        // Override to add custom bulk actions
        protected function configureBulkActions(): void
        {
            $this->bulkAction('publish', 'Publish')
                 ->linkToCrudAction('publishAction');
        }
    }
    

2. Customizing the Admin Panel

Leverage the bundle’s Twig extensions for:

  • Dynamic UI: Use eadmin_custom_js or eadmin_custom_css in templates.
  • Event Listeners: Attach to eadmin.pre_build_menu or eadmin.post_render:
    # config/services.yaml
    services:
        App\EventListener\AdminMenuListener:
            tags:
                - { name: kernel.event_listener, event: eadmin.pre_build_menu, method: onBuildMenu }
    

3. Integration with Symfony Forms

Reuse the bundle’s form types (if provided) for consistency:

use Aequation\EAdminBundle\Form\Type\CustomFieldType;

$builder->add('status', CustomFieldType::class, [
    'choices' => ['draft', 'published'],
]);

4. Workflow: Adding a Feature

  1. Check for existing traits/methods in AdminController.
  2. Extend or override (e.g., configureFields(), configureActions()).
  3. Test in a dedicated CRUD controller before applying globally.

Gotchas and Tips

Pitfalls

  1. Namespace Collisions The bundle uses Aequation\EAdminBundle—ensure your project doesn’t shadow this namespace. Fix: Use fully qualified class names or aliases in config/autoload.php.

  2. EasyAdmin Version Mismatch The bundle assumes EasyAdmin 4.x. Upgrading EasyAdmin may break features. Tip: Pin versions in composer.json:

    "easyadmin/bundle": "^4.0",
    "aequation/eadmin": "dev-main"
    
  3. Missing Documentation With 0 stars/dependents, assume undocumented features. Use:

    grep -r "public function" src/
    

    to explore available methods.

  4. Event System Quirks Events like eadmin.post_render may fire after the response is sent. Use kernel.response events for late-stage modifications.

Debugging Tips

  • Enable Symfony Debug Toolbar to inspect:
    • Twig variables (_eadmin namespace).
    • HTTP headers (for AJAX bulk actions).
  • Log Event Dispatches:
    // In a listener
    $this->logger->info('Event triggered', ['event' => $event->getName()]);
    

Extension Points

  1. Custom Bulk Actions Override configureBulkActions() and define routes in routes/eadmin.yaml:

    eadmin_bulk_publish:
        path: /posts/publish
        methods: POST
        controller: App\Controller\Admin\PostCrudController::publishAction
    
  2. Twig Extensions Add custom filters/functions by implementing TwigExtension and tagging it:

    tags:
        - { name: twig.extension }
    
  3. Database Abstraction If the bundle includes DBAL helpers, wrap queries in transactions:

    $entityManager->beginTransaction();
    try {
        $this->bulkActionService->execute($entities);
        $entityManager->commit();
    } catch (\Exception $e) {
        $entityManager->rollback();
        throw $e;
    }
    

Pro Tips

  • Use dump() Sparingly: Replace with var_export() for cleaner logs.
  • Test Bulk Actions: Use curl to simulate POST requests:
    curl -X POST -d "ids[]=1&ids[]=2" http://localhost/eadmin/posts/bulk-publish
    
  • Leverage Symfony’s Profiler to trace:
    • Doctrine queries (for bulk operations).
    • Twig template rendering times.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui