Exemplo n.º 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);
 }
Exemplo n.º 2
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.');
     }
 }