laravel tips and tricks 2020 code example
Example 1: laravel tricks and tips
Route::get('logout', function()
{
Auth::logout();
return Redirect::home();
});
//@sujay
Example 2: laravel tricks and tips
$user = [
'email' => 'email',
'password' => 'password'
];
if (Auth::attempt($user))
{
// user is now logged in!
// Access user object with Auth::user()
}
//@sujay