%PDF- %PDF-
Direktori : /www/loslex/test/app/Http/Requests/ |
Current File : //www/loslex/test/app/Http/Requests/RegistrationUpdateRequest.php |
<?php namespace App\Http\Requests; use App\Enums\ContestLevelEnum; use App\Rules\RegistrationDivision; use Illuminate\Foundation\Http\FormRequest; class RegistrationUpdateRequest 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|string> */ public function rules(): array { return [ 'user_id' => 'required|integer|exists:users,id', 'contest_id' => 'required|integer', 'contest_division_id' => 'bail|required_unless:contest_level_id,' . ContestLevelEnum::NOSHOOT->value . '|exists:contest_divisions,id', 'squad' => 'required|integer|declined_if:referee,on', 'licence_number' => ['nullable','string','regex:/^((AL|ZP)\d{6})|(EZP-\d{5,7})$/i'], 'lexmember' => 'sometimes|accepted', 'lex_hash' => 'exclude_without:lexmember|alpha_num:ascii|size:8|unique:users,lex_hash,'.$this->user_id, 'note' => 'nullable|string|max:255', 'notcomp' => 'sometimes|accepted', 'rookie' => 'sometimes|accepted', 'builder' => 'sometimes|accepted', 'referee' => 'accepted_if:squad,0', 'gdpr' => 'accepted' ]; } }