-
app/Http/Requests/SubCategory/CreateSubCategoryRequest.php
Open in GitHubuse Illuminate\Foundation\Http\FormRequest; class CreateSubCategoryRequest extends FormRequest { public function authorize() { return true; } public function rules() { $id = $this->route('id'); return [ 'name' => 'required:sub_categories,name,' .$id, 'category_id' => 'required', 'slug' => 'unique:sub_categories,slug,'.$id, ]; } }