a bit of progress

This commit is contained in:
2026-07-04 17:09:55 +03:00
parent f6e7d37428
commit 082b532d52
29 changed files with 2734 additions and 47 deletions
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace App\Http\Requests\Game;
use Illuminate\Foundation\Http\FormRequest;
class TrainRequest 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 [
'stat' => ['required', 'string', 'in:strength,defense,speed,dexterity'],
];
}
/**
* Get custom messages for validator errors.
*
* @return array<string, string>
*/
public function messages(): array
{
return [
'stat.required' => 'You must select a stat to train.',
'stat.string' => 'The stat must be a string.',
'stat.in' => 'The selected stat is invalid. Valid stats are: strength, defense, speed, dexterity.',
];
}
}