40 lines
904 B
PHP
40 lines
904 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Fo;
|
|
|
|
class CompleteInfosRequest extends RegisterRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize()
|
|
{
|
|
$this->merge([
|
|
'opt_in' => $this->opt_in ? true : false,
|
|
'agree' => $this->agree ? true : false
|
|
]);
|
|
return auth('customer')->check();
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return \array_intersect_key(parent::rules(), [
|
|
'firstname' => '',
|
|
'lastname' => '',
|
|
'birth_date' => '',
|
|
'address' => '',
|
|
'postcode' => '',
|
|
'country' => '',
|
|
'city' => '',
|
|
'phone' => '',
|
|
'opt_in' => ''
|
|
]);
|
|
}
|
|
}
|