public function destroy($id) { $post = $this->model->find($id); $post->tags()->detach(); $post->delete(); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $this->blog->destroy($id); return back()->with('ok', 'Delete post successfully.'); }