title: laravel route with parameter not coming from url
body: <p>I have multiple routes that look like this:</p>
  
  <pre><code>Route::get('pending-submit', 'CasesController@cases');
  Route::get('submited', 'CasesController@cases');
  Route::get('closed', 'CasesController@cases');
  </code></pre>
  
  <p>I have been looking around even in the router API documentation and I can't find a solution for my requirement other than creating multiple methods within the controller. The method does the exact same query except for adding a where clause to identify the different status between each case, what I was trying to do is have a method like this</p>
  
  <pre><code>public function cases($whereStatus = 0){
      return Cases::where('status', $whereStatus)-&gt;get();
  }
  </code></pre>
  
  <p>Instead of doing this:</p>
  
  <pre><code>public function pendingCases(){
      return Cases::where('status', 0)-&gt;get();
  }
  
  public function submitedCases(){
      return Cases::where('status', 1)-&gt;get();
  }
  
  public function closedCases(){
      return Cases::where('status', 2)-&gt;get();
  }
  </code></pre>
  
  <p>But I can figure a way to pass that parameter to the method from the route so I now have to create a method for each route which does not seem necessary to me. I understand I could just generate urls with the get parameter in it but I wanted to make that cleaner, is there a way for me to add that parameter without having it in the url?</p>
  
  <p>By the way, I also tried something like this which did not wok:</p>
  
  <pre><code>Route::get(
      'pending-submit',
      array(
          'uses'   =&gt; 'CasesController@cases',
          'params' =&gt; array(
              'filter' =&gt; 0
          )
      )
  );
  </code></pre>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>I understand I can make URLs like <a href="https://someurl.com/cases?status=0" rel="nofollow">https://someurl.com/cases?status=0</a> and can also have URLs like <a href="https://someurl.com/cases" rel="nofollow">https://someurl.com/cases</a> which require a different method per route however what I want is have URLs like <a href="https://someurl.com/cases" rel="nofollow">https://someurl.com/cases</a> and have a single method where the parameter is passed by the router instead of me getting it from the request so I can do it like this:</p>
  
  <pre><code>public function myMethod($param){
      /*
       * Here I access the $param without calling Request::input('someparam');
       * or without Request::path() where then I have to check what path is it
      */
      echo $param; /* this should already have the param from the route */
  }
  </code></pre>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>@AndyNoelker what I have is 3 different values either 0, 1 or 2</p>
  
  <p>I want to have something like this</p>
  
  <pre><code>Route::get(
      'cases',
      array(
          'uses'   =&gt; 'CasesController@cases',
          'status' =&gt; 0 /* this is what I need */
      )
  );
  </code></pre>
  
  <p>If not possible from the routes.php it is fine, I just want to know, all other methods you are giving me is not what I want or asking for since I already know how to do those.</p>