description |
---|
Gates is the way to inform your api consumers what actions are allowed on different models. |
If you are not familiar with what a "Gate" is, please have a look at the Laravel Documentation.
Laravel Rest Api takes advantage of this feature to provide your frontend users direct access to the current authenticated user rights.
Gates are enabled by default. You just have to provide the one you want in your search endpoint.
If you don't want to use this feature you have two ways to disable it:
In your config/rest.php
file, you can directly specify to disable this feature:
[
// ...
'gates' => [
'enabled' => false, // Switch this to false
]
// ...
]
If you want to disable this feature for certain resources only, you can use the DisableGates
trait on your resource file:
class UserResource extends Resource
{
use \Lomkit\Rest\Concerns\Resource\DisableGates;
// ...
}