Inheritance: extends Eloquen\Eloquent, implements Robbo\Presenter\PresentableInterface
Beispiel #1
0
 public function index()
 {
     $page = Post::where('permalink', '=', 'welcome')->first();
     $slides = Slideshow::latest()->get();
     $this->layout->title = 'Home';
     $this->layout->content = View::make('public.' . $this->current_theme . '.index')->with('page', $page)->with('slides', $slides);
 }
 /**
  * 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}.modules.doptor.slideshow.index")->with('success_message', 'The slide was deleted.');
     } else {
         return Redirect::route("{$this->link_type}.modules.doptor.slideshow.index")->with('error_message', 'The slide was not deleted.');
     }
 }