35 lines
790 B
PHP
35 lines
790 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class EmployeeAddressUpdateRequest extends FormRequest
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Determine if the user is authorized to make this request.
|
||
|
|
*
|
||
|
|
* @return bool
|
||
|
|
*/
|
||
|
|
public function authorize()
|
||
|
|
{
|
||
|
|
return auth('employee')->check();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the validation rules that apply to the request.
|
||
|
|
*
|
||
|
|
* @return array
|
||
|
|
*/
|
||
|
|
public function rules()
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'address' => 'required|string|min:5',
|
||
|
|
'city' => 'required|string|min:2',
|
||
|
|
'postcode' => 'required|digits_between:5,7',
|
||
|
|
'phone' => 'required|numeric|digits_between:10,12',
|
||
|
|
'mobile' => 'required|numeric|digits_between:10,12',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|