title: Laravel how to filter widlcard subdomains?
body: <p>Trying to filter a route based on a wild card subdomain. So basically we have a site <code>example.com</code>. I want to filter it based on some subdomains like <code>local.admin.example.com</code> and <code>admin.example.com</code>.</p>
  
  <p>I have a route setup like so:</p>
  
  <pre><code>Route::group(['domain' =&gt; '{sub}.example.com', 'namespace' =&gt; 'Controllers\Admin'], function()
  {
      Route::get('/', function(){ return Redirect::to('/dashboard'); });
  
      Route::any('{all}', function($uri){ return Redirect::to('/404'); })-&gt;where('all', '.*');
  
  })-&gt;where('sub', 'local.admin');
  </code></pre>
  
  <p>When I add the <code>-&gt;where</code> it just gives me an error:</p>
  
  <pre><code>Call to a member function where() on a non-object
  </code></pre>
  
  <p>Basically I just wanna capture anything with <code>admin</code> in the domain and make it go to that route group. I know I could do this with some <code>if</code> statements, but seems to me cleaner to do it with a group.  Or are <code>if</code> statements the way to go here?</p>