27 lines
706 B
PHP
27 lines
706 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Management;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpsertWheelchairAllocationRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user()?->hasRole('Admin') === true;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'election_id' => ['required', 'integer', 'exists:elections,id'],
|
|
'pusat_mengundi_id' => ['required', 'integer', 'exists:pusat_mengundis,id'],
|
|
'allocated_quantity' => ['required', 'integer', 'min:0', 'max:9999'],
|
|
'notes' => ['nullable', 'string', 'max:2000'],
|
|
];
|
|
}
|
|
}
|