Faisal Ahsan
Faisal Ahsan

Reputation: 918

Laravel package development

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?

Upvotes: 0

Views: 102

Answers (1)

ARIF MAHMUD RANA
ARIF MAHMUD RANA

Reputation: 5166

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

Upvotes: 1

Related Questions