/** * Display a listing of the resource. * * @return Response */ public function index() { $statistics = (object) array('schools_count' => School::all()->count(), 'municipalities_count' => Municipality::all()->count(), 'visitor_likes_count' => VisitorLikes::all()->count(), 'visitor_comments_count' => VisitorComments::all()->count()); $home_schools = School::orderBy('created_at', 'desc')->take(5)->get(); $home_comments = VisitorComments::orderBy('created_at', 'desc')->take(5)->get(); return View::make('admin.home')->with('home_schools', $home_schools)->with('home_comments', $home_comments)->with('statistics', $statistics); }