Skip to content
Advertisement

Target class [AppListenersCartUpdatedListener] does not exist

i want to configure events in choping cart uses LaravelShoppingcart package, i run cmd following php artisan make: listener CartUpdateListener, but it gives me error Target class [App Listeners CartUpdatedListener] does not exist.

EventServiceProvider.php

protected $listen = [
        'cart.added' => [
            'AppListenersCartUpdatedListener',
        ],
        'cart.updated' => [
            'AppListenersCartUpdatedListener',
        ],
        'cart.removed' => [
            'AppListenersCartUpdatedListener',
        ],
    ];

CartUpdateListener.php

 /**
     * Handle the event.
     *
     * @param  object  $event
     * @return void
     */
    public function handle($event)
    {
       dd("event was fired");
    }

Advertisement

Answer

Your error tells us about CardUpdatedListener but your file name is CardUpdateListener (an extra ‘d’ in the word Update). Check it, or post full class code.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement