Exemplo n.º 1
0
 /**
  * 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.');
 }
Exemplo n.º 2
0
 /**
  * Destroy a model.
  *
  * @param  int $id
  * @return void
  */
 public function destroy($id)
 {
     $this->model = $this->getById($id);
     $this->model->delete();
     return $this->model;
 }