Exemplo n.º 1
0
 public function get_index()
 {
     // get all critts of current user
     $allcritts = Critt::where('user_id', '=', Auth::user()->id);
     // order the critts by date and paginate into chunks of 10 critts
     $critts = $allcritts->order_by('updated_at', 'desc')->paginate(10);
     // count all critts
     $count = $allcritts->count();
     // count all followers
     $followers = Follower::where('following_id', '=', Auth::user()->id)->count();
     // make the user.profile view
     return View::make('user.profile')->with('count', $count)->with('followers', $followers)->with('critts', $critts);
 }