Last active
November 11, 2017 14:26
-
-
Save imranrbx/c05683805127086d71f38e5cdc7daecd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\SocialMedia; | |
class Facebook{ | |
protected $client_id; | |
private $client_secret; | |
public $redirect_url; | |
public function __construct($facebook){ | |
$this->client_id = $facebook['client_id']; | |
$this->client_secret = $facebook['client_secret']; | |
$this->redirect_url = $facebook['redirect']; | |
} | |
public function getClientID(){ | |
return $this->client_id; | |
} | |
public function getClientSecret(){ | |
return $this->client_secret; | |
} | |
public function getRedirectURL(){ | |
return $this->redirect_url; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use App\SocialMedia\Facebook; | |
class FacebookServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Bootstrap the application services. | |
* | |
* @return void | |
*/ | |
public function boot() | |
{ | |
// | |
} | |
/** | |
* Register the application services. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
$this->app->bind("App\SocialMedia\Facebook", function(){ | |
return new Facebook(config('services.facebook')); | |
}); | |
$this->app->make("App\SocialMedia\Facebook"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
use App\Post; | |
use App\User; | |
use Illuminate\Http\Request; | |
use DB; | |
use Auth; | |
use Facebook; | |
class PostController extends Controller | |
{ | |
/** | |
* Display a listing of the resource. | |
* | |
* @return \Illuminate\Http\Response | |
*/ | |
public function index(Facebook $fb){ | |
dd($fb); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment