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

Wide Eyes Bundle Laravel Package

answear/wide-eyes-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Check Compatibility: Verify your project meets the new requirements:

    • Symfony ≥6.0 (Symfony 7+ officially supported)
    • PHP ≥8.2 Run composer show symfony/* and php -v to confirm.
  2. Installation:

    composer require answear/wide-eyes-bundle:^3.0
    

    Add the bundle to config/bundles.php:

    return [
        // ...
        WideEyes\Bundle\WideEyesBundle::class => ['all' => true],
    ];
    
  3. First Use Case:

    • For Symfony-based Laravel projects (e.g., API Platform, Symfony-integrated apps), use the bundle’s event listeners or services directly.
    • Example: Trigger a WideEyes\Event\EyeEvent in a controller:
      use WideEyes\Event\EyeEvent;
      use Symfony\Component\EventDispatcher\EventDispatcherInterface;
      
      public function __construct(private EventDispatcherInterface $dispatcher) {}
      
      public function someAction() {
          $this->dispatcher->dispatch(new EyeEvent());
      }
      

Implementation Patterns

Symfony Integration

  • Event-Driven Workflows: Subscribe to WideEyes\Event\* events in Symfony’s services.yaml:

    services:
        App\Listener\MyListener:
            tags:
                - { name: 'kernel.event_listener', event: WideEyes\Event\EyeEvent, method: onEyeEvent }
    
  • Dependency Injection: Autowire services from the bundle (e.g., WideEyes\Service\EyeService) in Laravel controllers or Symfony commands.

Laravel-Specific Adaptations

  • Service Providers: Register Symfony services as Laravel bindings in AppServiceProvider:

    public function register() {
        $this->app->singleton(
            WideEyes\Service\EyeService::class,
            fn($app) => $app->make('wide_eyes.eye_service')
        );
    }
    
  • Console Commands: Use Symfony’s container-aware commands:

    use Symfony\Component\Console\Command\Command;
    use WideEyes\Service\EyeService;
    
    class MyCommand extends Command {
        public function __construct(private EyeService $eyeService) {}
        // ...
    }
    

Gotchas and Tips

Breaking Changes (3.0.0)

  1. Symfony/PHP Version Drop:

    • Symfony <6.0: Replace with symfony/ux or similar alternatives.
    • PHP <8.2: Upgrade PHP or use 2.x branch (if still available).
    • Debugging: Check composer why-not for dependency conflicts.
  2. Namespace/Class Changes:

    • Verify all use statements (e.g., WideEyes\Bundle\*WideEyes\*).
    • Run php artisan optimize:clear after updates.

Debugging Tips

  • Event Dispatching: Enable Symfony’s debug toolbar (APP_DEBUG=true) to inspect dispatched events.

    $this->dispatcher->addListener(EyeEvent::class, fn($event) => error_log('Event triggered!'));
    
  • Configuration: Override bundle defaults via config/packages/wide_eyes.yaml:

    wide_eyes:
        enabled: true
        debug: '%kernel.debug%'
    

Extension Points

  • Custom Events: Extend WideEyes\Event\EyeEvent for project-specific logic:

    class CustomEyeEvent extends EyeEvent {
        public function __construct(private string $customData) {}
        public function getCustomData(): string { return $this->customData; }
    }
    
  • Service Decorators: Decorate EyeService to modify behavior:

    services:
        wide_eyes.eye_service.decorated:
            decorates: wide_eyes.eye_service
            arguments: ['@wide_eyes.eye_service.decorated.inner']
    
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.
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
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver