Files
alrahma_sunday_school_api/app/Http/Requests/Whatsapp/WhatsappLinkIndexRequest.php
T
2026-03-10 16:31:35 -04:00

37 lines
1.1 KiB
PHP

<?php
namespace App\Http\Requests\Whatsapp;
use App\Http\Requests\ApiFormRequest;
use Illuminate\Validation\Rule;
class WhatsappLinkIndexRequest extends ApiFormRequest
{
public function authorize(): bool
{
return auth()->check();
}
public function rules(): array
{
return [
'school_year' => ['nullable', 'string', 'max:20'],
'semester' => ['nullable', 'string', 'max:20'],
'class_section_id' => ['nullable', 'integer', 'min:1'],
'active' => ['nullable', 'boolean'],
'search' => ['nullable', 'string', 'max:2000'],
'per_page' => ['nullable', 'integer', 'min:1', 'max:200'],
'page' => ['nullable', 'integer', 'min:1'],
'sort_by' => ['nullable', 'string', Rule::in([
'class_section_id',
'class_section_name',
'school_year',
'semester',
'active',
'updated_at',
])],
'sort_dir' => ['nullable', 'string', Rule::in(['asc', 'desc'])],
];
}
}