Files
thecrimesynticate/app/Http/Requests/Game/AttemptCrimeRequest.php
T

42 lines
938 B
PHP
Raw Normal View History

2026-07-04 17:09:55 +03:00
<?php
namespace App\Http\Requests\Game;
use Illuminate\Foundation\Http\FormRequest;
class AttemptCrimeRequest 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 [
'crime_id' => ['required', 'exists:crimes,id'],
];
}
/**
* Get custom messages for validator errors.
*
* @return array<string, string>
*/
public function messages(): array
{
return [
'crime_id.required' => 'You must select a crime to attempt.',
'crime_id.exists' => 'The selected crime does not exist.',
];
}
}