ldc-cocotte/app/Http/Requests/CustomerRegisterRequest.php
2021-03-26 16:10:56 +01:00

43 lines
1 KiB
PHP

<?php
namespace App\Http\Requests;
use Carbon\Carbon;
use Illuminate\Foundation\Http\FormRequest;
use App\Rules\Adult;
class CustomerRegisterRequest 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
*/
public function rules()
{
return [
'lastname' => 'required|string|max:255',
'firstname' => 'required|string|max:255',
'phone' => 'sometimes|max:255',
'address' => 'sometimes|max:255',
'postal_code' => 'required',
'town' => 'required|string|max:255',
'email' => 'required|email:rfc,dns,spoof|max:255',
'password' => 'required|confirmed|min:8|max:255',
'ok_cgv' => 'accepted',
'optin' => 'sometimes',
'birth_date' => ['required',new Adult()],
];
}
}