示例#1
0
 /**
  * @param int $id
  * @return mixed
  */
 public function destroy($id)
 {
     if ($item = $this->repository->find($id)) {
         if ($this->repository->delete($id)) {
             return $item;
         }
     }
     return null;
 }
 /**
  * @param int $id
  * @return null
  */
 public function destroy($id)
 {
     if ($item = $this->repository->find($id)) {
         if ($this->repository->delete($id)) {
             return redirect()->route("{$this->getBaseRoute()}.index");
         }
     }
     abort(404);
 }