user()->can('update', $this->route('post')); } /** * @return array|string> */ public function rules(): array { return [ 'title' => ['required', 'string', 'max:255'], 'content' => ['required', 'string'], 'slug' => ['required', 'string', 'max:255', 'regex:/^[a-z0-9-]+$/', Rule::unique('posts', 'slug')->ignore($this->route('post'))], 'status' => ['required', Rule::enum(PostStatus::class)], ]; } }