/** * Remove the specified resource from storage * * @api * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $this->item = call_user_func($this->model . '::findOrFail', $id); $this->beforeDestroy(); $this->item->delete(); return $this->redirector->getRedirect('destroy')->with('success', $this->name_singular . ' has been deleted.'); }
/** * Destroy a model. * * @param int $id * @return void */ public function destroy($id) { $this->model = $this->getById($id); $this->model->delete(); return $this->model; }