40 lines
958 B
PHP
40 lines
958 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Recharge;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class RechargeRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'money' => 'required|numeric|min:200000',
|
|
'bankCode' => 'nullable|string',
|
|
];
|
|
}
|
|
|
|
|
|
public function messages()
|
|
{
|
|
return [
|
|
'money.required' => 'Vui lòng nhập số tiền cần nạp.',
|
|
'money.numeric' => 'Số tiền phải là một số.',
|
|
'money.min' => 'Số tiền nạp vui lòng lớn hơn hoặc bằng 200.000vnđ',
|
|
];
|
|
}
|
|
}
|