Guards
Defining Guards for different authentication methods
Guards determine how users are authenticated.
Types:
- web: Session-based
- api: Token-based
Usage:
- Defining custom guards
- Using different guards in one application
Examples
Using Guard
Auth::guard('api')->attempt($credentials);
Auth::guard('web')->user();
Using different guards.