- make deals reachable - add recent search feature - add animation in profile menu - refactor blade markup of explore page
33 lines
836 B
PHP
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'],
|
|
];
|
|
}
|
|
}
|