Skip to content

Customize Gate in request #156

@RehArk

Description

@RehArk

Description

Type : Feature
Bug : No

The request only accepts CRUD and forceDelete gates, and it is not customizable.
https://laravel-rest-api.lomkit.com/endpoints/search#gates

We can manually add gates to a resource by extending the buildGatesForModel method in Lomkit\Rest\Http\Response, but requests using Lomkit\Rest\Rules\SearchRules do not expect this in the validate method:

$attribute.'gates' => ['sometimes', 'array', Rule::in(['viewAny', 'view', 'create', 'update', 'delete', 'restore', 'forceDelete'])],

It's possible to create a getGatesKey method in controller (or resource) or something like this to override the default gates ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions