laravel检查身份验证
use Illuminate\Support\Facades\Auth;
if (Auth::check()) {
// The user is logged in...
}
laravel make auth
Laravel's laravel/ui package provides a quick way to scaffold all of the routes and views you need for authentication using a few simple commands:
composer require laravel/ui
php artisan ui vue --auth
laravel auth
//namespace
use Illuminate\Support\Facades\Auth;
auth::在laravel中登录
public function manualLogin(){
$user = User::find(1);
Auth::login($user);
return redirect('/');
}
or
Auth::logout();
在laravel7中进行身份验证
composer require laravel/ui "^2.0"
laravel认证示例
php artisan make:auth