47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Bo\Dutyhours;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class StoreDutyhourRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return Gate::allows('isAdmin');
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'date' => 'required|date|after_or_equal:today',
|
|
'person' => 'required|string|min:3|max:255',
|
|
'place' => 'required|string|min:3|max:255',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get custom attributes for validator errors.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'date' => trans('Date de la permanence'),
|
|
'person' => trans('Personne associée à la permanence'),
|
|
'place' => trans('Lieu de la permanence'),
|
|
];
|
|
}
|
|
}
|