/** @test */
 public function the_default_config_can_be_overwritten_by_passing_arguments_to_get_login_url()
 {
     $this->url_mock->shouldReceive('to')->with('https://poop.fart/callback')->once()->andReturn('https://poop.fart/callback');
     $this->config_mock->shouldReceive('get')->never();
     $login_url = $this->laravel_facebook_sdk->getLoginUrl(['dance', 'totes'], 'https://poop.fart/callback');
     $this->assertContains('redirect_uri=https%3A%2F%2Fpoop.fart%2Fcallback', $login_url);
     $this->assertContains('scope=dance%2Ctotes', $login_url);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Facebook $fb)
 {
     //
     $login_url = $fb->getLoginUrl(['email']);
     return view('index', array('login_url' => $login_url));
     echo '<a href="' . $login_url . '">Login with Facebook</a>';
 }
Example #3
0
 /**
  * Create a new controller instance.
  *
  * @return void
  */
 public function __construct(LaravelFacebookSdk $fb, Menu $menu, ProjectRepository $project_repo)
 {
     $this->middleware('auth');
     $this->menuItems = $menu->where('active', '1')->orderBy('weight', 'asc')->get();
     $this->login_url = $fb->getLoginUrl(['email']);
     $this->project_repo = $project_repo;
 }
 public function login(SammyK\LaravelFacebookSdk\LaravelFacebookSdk $fb)
 {
     $login_link = $fb->getLoginUrl(['email']);
     //return $login_link;
     return view('auth/facebook')->with('login_link', $login_link);
     //echo '<a href="' . $login_link . '">Log in with Facebook</a>';
     //$fb=new Facebook();
     // Send an array of permissions to request
     //$login_url = $fb->getLoginUrl(['email']);
     //		$login_link =$fb->getRedirectLoginHelper()
     //			->getLoginUrl('https://localhost/facebook/callback', ['email', 'user_events']);
     //
     //		echo '<a href="' . $login_link . '">Log in with Facebook</a>';
 }
Example #5
0
 /**
  * Create a new controller instance.
  *
  * @return void
  */
 public function __construct(LaravelFacebookSdk $fb, Menu $menu, UserRepository $userrepo, ProjectRepository $project_repo)
 {
     $this->middleware('auth');
     $this->menuItems = $menu->where('active', '1')->orderBy('weight', 'asc')->get();
     $this->login_url = $fb->getLoginUrl(['email']);
     $this->userrepo = $userrepo;
     $this->project_repo = $project_repo;
     $id = Auth::user()->id;
     $userProfile = Profile::where('user_id', $id)->first();
     $errorNotification = '0';
     if ($userProfile->f_name == '' || $userProfile->l_name == '' || $userProfile->dob == '0000-00-00' || $userProfile->about_me == '' || $userProfile->first_address == '' || $userProfile->alternate_address == '' || $userProfile->state == '' || $userProfile->zipcode == '' || $userProfile->user_avtar == '') {
         $errorNotification = '1';
     }
     $this->errorNotification = $errorNotification;
 }
Example #6
0
 /**
  * Create a new controller instance.
  *
  * @return void
  */
 public function __construct(LaravelFacebookSdk $fb, ProjectRepository $project_repo)
 {
     $this->login_url = $fb->getLoginUrl(['email']);
     $this->project_repo = $project_repo;
     Visitor::log();
 }
Example #7
0
 public function __construct(Menu $menu, LaravelFacebookSdk $fb)
 {
     $this->menuItems = $menu->where('active', '1')->orderBy('weight', 'asc')->get();
     $this->login_url = $fb->getLoginUrl(['email']);
 }