/** * Remove post with given id * * @param $id * @return mixed */ public function remove($id) { $post = $this->getRepository()->find($id); EntityManager::remove($post); EntityManager::flush(); return Redirect::route('post.list'); }
/** * DELETE: Remove single object post by id * @param $id * @return Response */ public function removeById($id) { $object = $this->getRepository()->find($id); EntityManager::remove($object); EntityManager::flush(); return Api::render($object, $this->getDefaultDetailsSerializerGroup()); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $article = EntityManager::find(Article::class, $id); if (!$article) { return view('doctrination.article.show', compact('article')); } EntityManager::remove($article); EntityManager::flush(); return redirect("articles"); }