|
|
|
|
@ -212,16 +212,6 @@ class ApplicationController extends Controller
|
|
|
|
|
$countries = config('contest.location_countries', []);
|
|
|
|
|
|
|
|
|
|
$companyRules = ['nullable', 'string', 'max:255'];
|
|
|
|
|
if ($this->signupSchemaHasKey($competition, 'entry_group')) {
|
|
|
|
|
$reqVals = $this->companyNameRequiredWhenEntryGroupValues($competition);
|
|
|
|
|
if (count($reqVals) > 0) {
|
|
|
|
|
$companyRules[] = Rule::requiredIf(function () use ($request, $reqVals): bool {
|
|
|
|
|
$eg = (string) $request->input('entry_group', '');
|
|
|
|
|
|
|
|
|
|
return in_array($eg, $reqVals, true);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$trackRules = count($trackCodes)
|
|
|
|
|
? ['nullable', 'string', Rule::in($trackCodes)]
|
|
|
|
|
@ -243,7 +233,7 @@ class ApplicationController extends Controller
|
|
|
|
|
'intro' => ['nullable', 'string', 'max:5000'],
|
|
|
|
|
];
|
|
|
|
|
if ($this->signupSchemaHasKey($competition, 'entry_group')) {
|
|
|
|
|
$rules['entry_group'] = ['required', 'string', Rule::in($this->allowedEntryGroupValues($competition))];
|
|
|
|
|
$rules['entry_group'] = ['nullable', 'string', Rule::in($this->allowedEntryGroupValues($competition))];
|
|
|
|
|
}
|
|
|
|
|
if ($this->signupSchemaRequiresCommitment($competition)) {
|
|
|
|
|
$rules['commitment_accepted'] = ['sometimes', 'boolean'];
|
|
|
|
|
|