edvinaskrucas / notification

Notification package for Laravel
MIT License
525 stars 99 forks source link

Unresolvable dependency resolving in Notification construct() #88

Closed martijnimhoff closed 7 years ago

martijnimhoff commented 7 years ago

Hi there, I'm getting the following bug after I implemented this package in Laravel using the documentation.

Unresolvable dependency resolving [Parameter #0 [ <required> $defaultContainer ]] in class Krucas\Notification\Notification

I'm on: Laravel 5.4 Package version 5.2.*

This is my middleware

protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
            \Krucas\Notification\Middleware\NotificationMiddleware::class,
        ],

        'api' => [
            'throttle:60,1',
            'bindings',
        ],
    ];

As for config/app.php This is in providers: Krucas\Notification\NotificationServiceProvider::class, And then call it like this: Notification::success('great success!');

I'm a bit stuck on this. Could anyone please help me?

martijnimhoff commented 7 years ago

Fixed it by commenting the declarations to the Notification class of Illuminate: 'Notification' => Illuminate\Support\Facades\Notification::class, Illuminate\Notifications\NotificationServiceProvider::class,