2020-03-31 10:32:08 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests\User;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
class UserChangePassword extends FormRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'old_password' => 'required',
|
|
|
|
'new_password' => 'required|min:8'
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function messages()
|
|
|
|
{
|
|
|
|
return [
|
2021-06-12 00:56:39 +08:00
|
|
|
'old_password.required' => __('Old password cannot be empty'),
|
|
|
|
'new_password.required' => __('New password cannot be empty'),
|
|
|
|
'new_password.min' => __('Password must be greater than 8 digits')
|
2020-03-31 10:32:08 +08:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|