title: Limit pagination Laravel 4 when page not exist
body: <p>i have this code:</p>
  
  <pre><code>    public function test(){
      $results = Cand::paginate(4);
  
      if (Request::ajax()) {
           return Response::json(View::make('admin.posts')-&gt;with('results', $results)-&gt;render());
      }
  
      $this-&gt;layout-&gt;content = View::make('admin.dashboard')-&gt;with('results', $results);
   }
  </code></pre>
  
  <p>It works fine, but when a user enters a page that does not exist in the URL, like "?page=9999", how can I restrict this?</p>