40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Fo;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class RegisterRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return auth('customer')->guest();
|
|
}
|
|
|
|
/**
|
|
* 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',
|
|
'birth_date' => 'required|string|max:10',
|
|
'email' => 'required|string|email:spoof,rfc,filter,dns|max:255|unique:users|confirmed',
|
|
'password' => 'required|string|min:8|confirmed',
|
|
'address' => 'required|string|max:255',
|
|
'address2' => 'max:255',
|
|
'town' => 'required|string|max:255',
|
|
'postal_code' => 'required|string|max:255',
|
|
'country' => 'required|string|max:255',
|
|
'reglement' => 'accepted',
|
|
];
|
|
}
|
|
}
|