Level 29
You can use actingAs to by pass the authentication.
Example
$user = User::factory()->create();
$this->actingAs($user,'your authentication guard');
https://laravel.com/docs/8.x/sanctum#testing
https://laravel.com/docs/8.x/http-tests#session-and-authentication
1 like