You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

51 lines
1.4 KiB

<?php
namespace App\Http\Requests\Users;
use Illuminate\Foundation\Http\FormRequest;
class UpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return $this->user()->can(
'edit', $this->route('user')
);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'nickname' => 'required|string|max:255',
'name' => 'required|string|max:255',
'gender_id' => 'required|numeric',
'dob' => 'nullable|date|date_format:Y-m-d',
'dod' => 'nullable|date|date_format:Y-m-d',
'yod' => 'nullable|date_format:Y',
'phone' => 'nullable|string|max:255',
'address' => 'nullable|string|max:255',
'city' => 'nullable|string|max:255',
'email' => 'nullable|string|max:255',
'password' => 'nullable|min:6|max:15',
'birth_order' => 'nullable|numeric|min:1',
];
}
public function messages()
{
return [
'password.current_password' => trans('passwords.old_password'),
'new_password.same_password' => trans('passwords.same_password'),
];
}
}