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