for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* NOTICE OF LICENSE
*
* Part of the Rinvex Fort Package.
* This source file is subject to The MIT License (MIT)
* that is bundled with this package in the LICENSE file.
* Package: Rinvex Fort Package
* License: The MIT License (MIT)
* Link: https://rinvex.com
*/
namespace Rinvex\Fort\Http\Requests\Backend;
use Rinvex\Support\Http\Requests\FormRequest;
class AbilityUpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
* @return bool
public function authorize()
return true;
}
* Get the validation rules that apply to the request.
* @return array
array<string,string>
This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.
array
public function rules()
return [
'action' => 'required|unique:'.config('rinvex.fort.tables.abilities').',action,'.$this->get('id').',id,resource,'.$this->get('resource'),
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.
'resource' => 'required|unique:'.config('rinvex.fort.tables.abilities').',resource,'.$this->get('id').',id,action,'.$this->get('action'),
'title' => 'required',
];
* Get custom messages for validator errors.
public function messages()
'action.unique' => 'The combination of (action & resource) fields has already been taken.',
'resource.unique' => 'The combination of (action & resource) fields has already been taken.',
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.