*/ public function rules(): array { return [ 'parent_id' => ['nullable', 'exists:categories,id', Rule::notIn([$this->route('category')?->id])], 'name' => ['sometimes', 'required', 'string', 'max:255'], 'slug' => ['sometimes', 'required', 'string', 'max:255', Rule::unique('categories', 'slug')->ignore($this->route('category'))], 'description' => ['nullable', 'string'], 'meta_title' => ['nullable', 'string', 'max:60'], 'meta_description' => ['nullable', 'string', 'max:160'], ]; } }