modelWithPolicy('ilaravels', ['guest']) ->getJson(route('api.ilaravels.show', $this->one(ILaravel::class))) ->assertOk(); } function test_guest_policy_fail() { $this->modelWithPolicy('ilaravels', ['guest']) ->loginAs() ->getJson(route('api.ilaravels.show', $this->one(ILaravel::class))) ->assertForbidden(); } }