44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Game;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class CharacterDepositRequest 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 [
|
|
'amount' => ['required', 'integer', 'min:1', 'max:1000000'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get custom messages for validator errors.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'amount.required' => 'You must enter an amount to deposit.',
|
|
'amount.integer' => 'The amount must be a whole number.',
|
|
'amount.min' => 'The minimum deposit amount is :min.',
|
|
'amount.max' => 'The maximum deposit amount is :max.',
|
|
];
|
|
}
|
|
}
|