Edit File: GetProvidersRequest.php
<?php namespace App\Http\Requests\Api\User\Home; use App\Enums\ProductDeliveryTypesEnum; use App\Http\Requests\Api\BaseApiRequest; use Illuminate\Validation\Rule; class GetProvidersRequest extends BaseApiRequest { public function rules() { return [ 'neighborhood_id' => ['nullable', 'numeric', 'exists:neighborhoods,id'], 'category_id' => ['nullable', 'numeric', 'exists:categories,id'], 'store_name' => ['nullable', 'string'], 'search' => ['nullable', 'string'], 'search_for' => [Rule::requiredIf($this->filled('search')), 'nullable', 'string', 'in:store,product'], 'delivery_type' => ['nullable', 'string', 'in:' . ProductDeliveryTypesEnum::Store->value . ',' . ProductDeliveryTypesEnum::Home->value], 'best_rated' => ['nullable', 'boolean', 'in:1'], ]; } }
Back to File Manager