芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/www/app/Http/Controllers/SocialController.php
redirect(); } public function loginWithFacebook() { try { $user = Socialite::driver('facebook')->user(); $isUser = User::where('fb_id', $user->id)->first(); if($isUser){ Auth::login($isUser); return redirect('/dashboard'); }else{ $createUser = User::create([ 'name' => $user->name, 'email' => $user->email, 'fb_id' => $user->id, 'password' => encrypt('admin@123') ]); Auth::login($createUser); return redirect('/dashboard'); } } catch (Exception $exception) { dd($exception->getMessage()); } } }