dealhub/app/Http/Requests/ExploreSearchSortRequest.php
kusowl 985dd967e4 feature(search deals)
- make deals reachable
- add recent search feature
- add animation in profile menu
- refactor blade markup of explore page
2026-01-20 18:43:13 +05:30

33 lines
836 B
PHP

<?php
namespace App\Http\Requests;
use App\Enums\ExplorePageFilters;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ExploreSearchSortRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'sortBy' => ['nullable', 'string', Rule::in(ExplorePageFilters::values())],
'search' => ['nullable', 'string', 'min:1', 'max:255'],
'category' => ['nullable', 'exists:deal_categories,id'],
];
}
}