30 lines
578 B
PHP
30 lines
578 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use App\Models\PreregistrationPage;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class QueueMailwizzSyncRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
$page = $this->route('page');
|
|
if (! $page instanceof PreregistrationPage) {
|
|
return false;
|
|
}
|
|
|
|
return $this->user()?->can('update', $page) ?? false;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, array<int, string>>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|