33 lines
735 B
PHP
33 lines
735 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use App\Models\PreregistrationPage;
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StorePreregistrationPageRequest extends FormRequest
|
|
{
|
|
use ValidatesPreregistrationPageInput;
|
|
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user()?->can('create', PreregistrationPage::class) ?? false;
|
|
}
|
|
|
|
protected function prepareForValidation(): void
|
|
{
|
|
$this->preparePreregistrationPageFields();
|
|
}
|
|
|
|
/**
|
|
* @return array<string, array<int, ValidationRule|string>>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return $this->preregistrationPageRules();
|
|
}
|
|
}
|