/** * @param \Minhbang\Ebook\Ebook $ebook * * @return \Illuminate\Http\JsonResponse * @throws \Exception */ public function destroy(Ebook $ebook) { if ($ebook->canDelete()) { $ebook->delete(); return Response::json(['type' => 'success', 'content' => trans('common.delete_object_success', ['name' => trans('ebook::common.ebooks')])]); } else { return Response::json(['type' => 'danger', 'content' => trans('ilib::common.messages.unable_delete')]); } }