Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to update the app id/secret #92

Merged
merged 6 commits into from
Nov 12, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/LaravelFacebookSdk/LaravelFacebookSdk.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php namespace SammyK\LaravelFacebookSdk;

use Facebook\Facebook;
use Illuminate\Config\Repository as Config;
use Illuminate\Routing\UrlGenerator as Url;
use Facebook\Facebook;

class LaravelFacebookSdk extends Facebook
{
Expand All @@ -25,10 +25,21 @@ public function __construct(Config $config_handler, Url $url, array $config)
{
$this->config_handler = $config_handler;
$this->url = $url;
$this->default_config = $config;

parent::__construct($config);
}

/**
* @param array $config
*/
public function newInstance(array $config)
{
$new_config = array_merge($this->default_config, $config);

return new static($this->config_handler, $this->url, $new_config);
}

/**
* Generate an OAuth 2.0 authorization URL for authentication.
*
Expand Down