Beispiel #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     $slide = Slideshow::findOrFail($id);
     File::exists($slide->image) && File::delete($slide->image);
     if ($slide->delete()) {
         return Redirect::route("{$this->link_type}.slideshow.index")->with('success_message', 'The slide was deleted.');
     } else {
         return Redirect::route("{$this->link_type}.slideshow.index")->with('error_message', 'The slide was not deleted.');
     }
 }