1public function show($id)
2{
3
4 // get the current user
5 $user = User::find($id);
6
7 // get previous user id
8 $previous = User::where('id', '<', $user->id)->max('id');
9
10 // get next user id
11 $next = User::where('id', '>', $user->id)->min('id');
12
13 return View::make('users.show')->with('previous', $previous)->with('next', $next);
14}