Complete the code to check if the user is authenticated using the default guard.
<?php if (Auth::[1]()) { // User is authenticated }
The check() method returns true if the user is authenticated with the default guard.
Complete the code to get the currently authenticated user from the 'admin' guard.
<?php $user = Auth::guard('[1]')->user();
The guard('admin') specifies the 'admin' guard to get the authenticated user from.
Fix the error in the code to log out the user from the 'api' guard.
<?php Auth::guard('[1]')->[2]();
The first blank must be the guard name 'api' to specify which guard to log out from.
Fill both blanks to check if the user is a guest on the 'web' guard.
<?php if (Auth::guard('[1]')->[2]()) { // User is a guest }
The 'web' guard is specified first, then the guest() method checks if the user is not authenticated.
Fill all three blanks to attempt login with email and password on the 'admin' guard.
<?php $credentials = ['email' => $email, 'password' => $password]; if (Auth::guard('[1]')->[2]([3])) { // Login successful }
The 'admin' guard is used, the attempt() method tries to log in with the given credentials array.