33 lines
919 B
PHP
33 lines
919 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
/** Validation for creating a competition (legacy `CompetitionWinnersController::store`). */
|
|
class StoreCompetitionWinnerRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'title' => ['required', 'string', 'min:3'],
|
|
'class_section_id' => ['nullable', 'integer'],
|
|
'semester' => ['nullable', 'string'],
|
|
'school_year' => ['nullable', 'string'],
|
|
'start_date' => ['nullable', 'date'],
|
|
'end_date' => ['nullable', 'date'],
|
|
'winner_overrides' => ['sometimes', 'array'],
|
|
'question_counts' => ['sometimes', 'array'],
|
|
'prizes' => ['sometimes', 'array'],
|
|
];
|
|
}
|
|
}
|