feat: Phase 2 - page CRUD, subscriber management, user management
This commit is contained in:
36
app/Http/Requests/Admin/UpdatePreregistrationPageRequest.php
Normal file
36
app/Http/Requests/Admin/UpdatePreregistrationPageRequest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdatePreregistrationPageRequest extends FormRequest
|
||||
{
|
||||
use ValidatesPreregistrationPageInput;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
$page = $this->route('page');
|
||||
if ($page === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->user()?->can('update', $page) ?? false;
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->preparePreregistrationPageFields();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, ValidationRule|string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return $this->preregistrationPageRules();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user