Laravel Basic Usage - Facade


Example

return Socialite::driver('facebook')->redirect();

This will redirect an incoming request to the appropriate URL to be authenticated. A basic example would be in a controller

<?php

namespace App\Http\Controllers\Auth;

use Socialite;

class AuthenticationController extends Controller {

    /**
     * Redirects the User to the Facebook page to get authorization.
     *
     * @return Response
     */
    public function facebook() {
        return Socialite::driver('facebook')->redirect();
    }

}

make sure your app\Http\routes.php file has a route to allow an incoming request here.

Route::get('facebook', 'App\Http\Controllers\Auth\AuthenticationController@facebook');