for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
// SocialAuthFacebookController.php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Socialite;
use App\Services\SocialFacebookAccountService;
class SocialAuthFacebookController extends Controller
{
/**
* Create a redirect method to twitter api.
*
* @return void
*/
public function redirect()
return Socialite::driver('facebook')->redirect();
}
* Return a callback method from twitter api.
* @return callback URL from twitter
public function callback(SocialFacebookAccountService $service)
$user = $service->createOrGetUser(Socialite::driver('facebook')->user());
auth()->login($user);
return redirect()->to('/home');