Auth::routes([
'register' => false, // Registration Routes...
'reset' => false, // Password Reset Routes...
'verify' => false, // Email Verification Routes...
]);
{{ auth()->user()->email }}
if (Auth::check()) { // The user is logged in... }
{{Auth::user()->username}}
$userId = Auth::id();
public function __construct()
{
$this->middleware(function ($request, $next) {
$this->user = Auth::user();
return $next($request);
});
}
Auth::user();
php artisan tinker
DB::table('users')->insert(['name'=>'MyUsername','email'=>'thisis@myemail.com','password'=>Hash::make('123456')])
use IlluminateSupportFacadesAuth;
// Retrieve the currently authenticated user...
$user = Auth::user();
// Retrieve the currently authenticated user's ID...
$id = Auth::id();
use IlluminateSupportFacadesAuth;
Auth::login($user);
Route::get('/flights', function () {
// Only authenticated users may access this route...
})->middleware('auth:admin');