SammyK / LaravelFacebookSdk

Fully unit tested Facebook SDK v5 integration for Laravel & Lumen
MIT License
692 stars 200 forks source link

Allow to update the app id/secret #92

Closed kxgio closed 8 years ago

kxgio commented 9 years ago

usage: $fb = App::make('SammyK\LaravelFacebookSdk\LaravelFacebookSdk'); $fb->updateAppIdSecret('your_app_id', 'your_app_secret');

SammyK commented 9 years ago

Thanks for the PR!

I think this would be better if we could send in an all new $config array so that different apps could use different options (like different versions of Graph for example). You can just array_merge() the existing config so that it will fallback to the original instance config for unspecified options.

Also the method should be named newInstance() and return a new instance of itself:

return new static($config);
SammyK commented 9 years ago

Hey @kxgen! Just wanted to check in with you to see if you'd be able to update your PR based on my feedback. If not, l can get in there and make the patch. :)

kxgio commented 9 years ago

Hi @SammyK , sorry to reply you so late, I just follow your guide and change the update method. So now we can use something like this to update app info:

$new_config = ['app_id' => 'you_app_id', 'app_secret' => 'you_app_secret'];
$fb->newInstance($new_config)->post('things you want to do');

right?

SammyK commented 9 years ago

Thanks @kxgen! Just change based on my comments and it should be good to pull in. :)

kxgio commented 9 years ago

:)

SammyK commented 8 years ago

Thanks! :)