Files
sam-api/app/Http/Requests/V1/Plan/PlanIndexRequest.php

26 lines
693 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests\V1\Plan;
use Illuminate\Foundation\Http\FormRequest;
class PlanIndexRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'is_active' => ['nullable', 'boolean'],
'billing_cycle' => ['nullable', 'string', 'in:monthly,yearly,lifetime'],
'search' => ['nullable', 'string', 'max:100'],
'sort_by' => ['nullable', 'string', 'in:price,name,created_at'],
'sort_dir' => ['nullable', 'string', 'in:asc,desc'],
'per_page' => ['nullable', 'integer', 'min:1', 'max:100'],
];
}
}