lundi 11 janvier 2016

How to properly install package in Laravel?

Recently, I installed the a package LaravelFacebookSdk.


Install

I update my composer.json by adding

"sammyk/laravel-facebook-sdk": "~3.0"

Then, I run composer update


Service Provider

In my /config/app.php, I add the LaravelFacebookSdkServiceProvider to the providers array.

'providers' => [
    SammyK\LaravelFacebookSdk\LaravelFacebookSdkServiceProvider::class,
    ];


Everything works great. Then, I pushed it to my repository.


Here comes the issue !

Second developer coming in did a git pull and run composer update

He will get an error

 SammyK\LaravelFacebookSdk\LaravelFacebookSdkServiceProvider::class,

is undefine. because, I declared that in my /config/app.php under my providers array.

He have to go comment out that line, and run the composer update first. After everything successfully installed, then go back in and uncomment that line back again.

Will other developer have to do this each time, we installed a new package ?

Am I missing something here ?

Please kindly advise if I did anything wrong.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire