improve code in controller and form request for V3 whit pint package
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Requests\V3\RoadObservation;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
@@ -9,22 +10,22 @@ class VerifyBySupervisorRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return Gate::allows('gate-supervise-road-observed',$this->roadObserved);
|
||||
return Gate::allows('gate-supervise-road-observed', $this->roadObserved);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{return [
|
||||
'verify' => ['required', 'in:1,2'],
|
||||
'description' => ['string'],
|
||||
];
|
||||
{
|
||||
return [
|
||||
'verify' => ['required', 'in:1,2'],
|
||||
'description' => ['string'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user