31 lines
995 B
PHP
31 lines
995 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreRegistrationRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool { return true; }
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'player.name' => ['required','string','max:120'],
|
|
'player.phone' => ['required','string','max:40'],
|
|
'player.email' => ['required','email','max:180'],
|
|
'player.club' => ['nullable','string','max:120'],
|
|
'player.shirt_size' => ['nullable','string','max:10'],
|
|
|
|
'handicap.type' => ['required','in:HI,EVENT_BAND'],
|
|
'handicap.value' => ['nullable','numeric','min:0','max:60'],
|
|
'handicap.band' => ['required','in:LOW,MID,HIGH,BEGINNER'],
|
|
|
|
'preferences.pairing_mode' => ['required','in:LEVEL,BALANCED,RANDOM'],
|
|
'preferences.course_pref' => ['required','in:A,B,ANY'],
|
|
|
|
'consent' => ['required','boolean'],
|
|
];
|
|
}
|
|
}
|