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