Laravel service provider is not found

Peter Hon picture Peter Hon · Apr 3, 2014 · Viewed 13.9k times · Source

When I access laravel, it said

Symfony \ Component \ Debug \ Exception \ FatalErrorException
'Krucas\Notification\NotificationServiceProvider' Not found

The Website locations is http://somedomain.com/index.php It's document physical path is :

C:/Apache24/htdocs/new_project/laravel/public/laravel1/public

And I have these setting in

C:/Apache24/htdocs/new_project/laravel/public/laravel1/app/config/app.php

providers array 'Krucas\Notification\NotificationServiceProvider'

Alias Array 'Notification'=> 'Krucas\Notification\Facades\Notification'

How can I know the Laravel maps the provider array and alias array to the physical path?

Answer

4givN picture 4givN · Oct 9, 2017

There were some cases with registration problem, cache issues, etc. Try one of these solutions:

  • register your provider (in main composer.json, then in config/app.php [provider & alias] ), then run composer dump-autoload
  • try php artisan config:cache or delete everything in bootstrap/cache/
  • make sure you have initiated your package : go to the folder, then composer init