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