For example, I have an HTTP request that handles some entity creation (let it be Role) And validation looks like this:
class CreateRole extends FormRequest
{
public function rules()
{
return [
'name' => 'required|string|max:255',
'permissions' => ['required', 'array'],
...
And I have some restrictions that are not related to either name or permission column. For example the maximum amount of roles that can be created.
Such custom validation can be placed to the name property, but it looks wrong.
PS: I know about custom validators. Question about where to place it...