0

I am trying to develop a Laravel package with a helper function, which returns a view. I have uploaded on GitHub already https://github.com/faisalahsan/laravel-breadcrums. When I install it through Packagist https://packagist.org/packages/faisalahsanse/laravel-breadcrums, it installs successfully, but when I register it in the provider array in my app.php as Faisalahsanse\Breadcrums\BreadcumsServiceProvider::class,. It gives the following error:

Class 'Faisalahsanse\Breadcrums\BreadcumsServiceProvider' not found

I don't know where I am getting wrong.

Any suggestions?

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
Faisal Ahsan
  • 928
  • 1
  • 12
  • 22

1 Answers1

1

Your namespace is wrong https://github.com/faisalahsan/laravel-breadcrums/blob/master/src/BreadcumsServiceProvider.php#L2

It should be Faisalahsan\LaravelBreadcrums. As this namespace you are adding in the composer.json file in psr-4 autoload.

Also your provider to add will be Faisalahsan\Breadcrums\BreadcumsServiceProvider::class

ARIF MAHMUD RANA
  • 5,026
  • 3
  • 31
  • 58
  • thank your reply, I have made changes according your answer, e.g same namespace in composer.json and breadcrumsserviceprovider file is `Faisalahsan\Breadcrums` and in my service provider array `Faisalahsan\Breadcrums\BreadcumsServiceProvider::class`, But giving same error. can you guide me? – Faisal Ahsan Dec 09 '15 at 10:08
  • it was my version error on packagist after your answer. Thanks again. – Faisal Ahsan Dec 09 '15 at 10:24