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.
 
 
 
 
 

43 lines
1.1 KiB

<?php
namespace App\Http\Requests\Accounts;
use App\Http\Requests\Request;
class ChangePasswordRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'old_password' => 'required',
'password' => 'required|between:6,15|confirmed',
'password_confirmation' => 'required',
];
}
public function messages()
{
return [
'old_password.required' => 'Password lama harus diisi.',
'password.required' => 'Password baru harus diisi.',
'password.between' => 'Password baru harus antara 6 - 15 karakter.',
'password.confirmed' => 'Konfirmasi password baru tidak sesuai.',
'password_confirmation.required' => 'Konfirmasi password baru harus diisi.',
];
}
}