Ejemplo n.º 1
0
 /**
  * Show view of homepage with public images (latest 6 images).
  *
  * @return object View
  */
 public function index()
 {
     return View::make('main/index')->with('title', 'Homepage')->with('images', Images::orderBy('created_at', 'desc')->where('private', 0)->limit(6)->get());
 }
 public function updateSiteMap()
 {
     $sitemap = App::make("sitemap");
     $posts = Images::orderBy('created_at', 'desc')->get();
     foreach ($posts as $post) {
         $sitemap->add(url('image/' . $post->id . '/' . $post->slug), $post->updated_at, '0.9');
     }
     $sitemap->store('xml', 'sitemap');
     return Redirect::to('admin')->with('flashSuccess', 'sitemap.xml is now updated');
 }
Ejemplo n.º 3
0
 /**
  * Showing list of public images (marked as 0 in private table).
  * Pagination by 42 items per page (infinite scrolling).
  *
  * @return object View
  */
 public function index()
 {
     return View::make('images/list')->with('title', 'List of images')->with('images', Images::orderBy('created_at', 'desc')->where('private', 0)->paginate('42'));
 }
Ejemplo n.º 4
0
 /**
  * Showing list of users images
  *
  * @return object View
  */
 public function showImages()
 {
     return View::make('user/index')->with('title', 'List of images')->with('images', Images::orderBy('created_at', 'desc')->where('user_id', Auth::user()->id)->get());
 }