/** * Remove the specified Author from storage. * * @param int $id * * @return Response */ public function destroy($id) { $author = $this->authorRepository->find($id); if (empty($author)) { Flash::error('Author not found'); return redirect(route('authors.index')); } $this->authorRepository->delete($id); Flash::success('Author deleted successfully.'); return redirect(route('authors.index')); }
/** * Remove the specified Author from storage. * DELETE /authors/{id} * * @param int $id * * @return Response */ public function destroy($id) { $this->authorRepository->apiDeleteOrFail($id); return $this->sendResponse($id, "Author deleted successfully"); }