/** * Remove the specified resource from storage. * * @param int $id * @throws Symfony\Component\HttpKernel\Exception\NotFoundHttpException * @return Response */ public function destroy($id) { $this->getCategory(); if (Article::destroy([$id])) { if ($this->request->ajax()) { return ['response' => 'success']; } return redirectTo($this->category->path); } throw new NotFoundHttpException(); }