Level 88
You can fake that a user is logged in. You can use the actingAs($user) method for this. Check this part of the documentation: https://laravel.com/docs/7.x/http-tests#session-and-authentication
1 like
I want to test out my service that use auth()->user? How do I mock this?
I just google that I could use $this->be() to authenticate myself.
Please or to participate in this conversation.