Beispiel #1
0
 public function getIndex()
 {
     $categories = array();
     foreach (Category::all() as $category) {
         $categories[$category->id] = $category->name;
     }
     return View::make('blog.posts.index')->with('posts', Post::orderBy('id', 'DESC')->paginate(10))->with('categories', $categories)->with('i', 0);
 }