Hi!
I have just made a nice NotifierServiceInterface with a concrete implementation in my class PusherNotifier. I've added
$this->app->bind('Traeningsprojekt\Notifier\NotificationServiceInterface', 'Traeningsprojekt\Notifier\PusherNotifier');
to the register()-method in AppServiceProvider.php, and the ServiceProvider is listed in config/app.php.
When I do App::make('Traeningsprojekt\Notifier\NotificationServiceInterface'); in php artisan tinker, I get the PusherNotifier class on my Homestead dev machine, but on my server I get this error:
>>> App::make('Traeningsprojekt\Notifier\NotificationServiceInterface');
Illuminate\Container\BindingResolutionException with message 'Target [Traeningsprojekt\Notifier\NotificationServiceInterface] is not instantiable.'
I have tried php artisan optimize and php artisan optimize --force as well as php artisan clear-compiled.
However it works both places, if I manually write in php artisan tinker:
App::bind('Traeningsprojekt\Notifier\NotificationServiceInterface', 'Traeningsprojekt\Notifier\PusherNotifier');
App::make('Traeningsprojekt\Notifier\NotificationServiceInterface');
So it seems to me that the binding is not being registered at all on the server! Maybe there is a compiled file "stuck" somewhere?
Can anyone help me get further with this?