user() && $this->user()->hasPermission('edit-posts'); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { $post = $this->route('post'); $id = $post instanceof \App\Models\Post ? $post->id : $post; return $this->baseRules($id); } }