ldc-jeusselin/app/Http/Requests/UpdateInfosRequest.php
Olivier Legat 4f7251acf1 Modif infos personnelles
Mail à l'admin pour cette action
2021-05-07 18:07:09 +02:00

42 lines
973 B
PHP

<?php
namespace App\Http\Requests;
use Carbon\Carbon;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class UpdateInfosRequest extends FormRequest
{
public function __construct()
{
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return Auth::guard('web')->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'firstname' => 'required|string|max:255',
'lastname' => 'required|string|max:255',
'birth_date' => 'required|date|before_or_equal:' . Carbon::now()->subYears(18)->toDateString(),
'address' => 'max:255',
'phone' => 'max:255',
'city' => 'required|string|max:255',
'postcode' => 'required'
];
}
}