title: Decide Laravel or Wordpress route in the index file
body: <p>I have an application which uses Laravel in combination with Wordpress.</p>
  
  <p>Now Laravel has routes and also wordpress.</p>
  
  <p>I want to check in the public/index.php if the url correspond with the Laravel route or Wordpress route.</p>
  
  <p>So, something like this works, but i want to fill dynamicly the $laravelRoutes array, but at that level there is no database connection.</p>
  
  <p>How can i achieve this correctly?</p>
  
  <p><strong>public/index.php</strong></p>
  
  <pre><code>$actual_link = "$_SERVER[REQUEST_URI]";
  $parts = explode('/',$actual_link);
  
  $laravelRoutes = ['admin','rest'];
  if (isset($parts[1])&amp;&amp; in_array($parts[1],$laravelRoutes) ){
      /**
       * Laravel - A PHP Framework For Web Artisans
       */
      require __DIR__.'/../bootstrap/autoload.php';
      $app = require_once __DIR__.'/../bootstrap/app.php';
      $kernel = $app-&gt;make(Illuminate\Contracts\Http\Kernel::class);
      $response = $kernel-&gt;handle(
          $request = Illuminate\Http\Request::capture()
      );
      $response-&gt;send();
      $kernel-&gt;terminate($request, $response);
  }else{
      /*
       // Loads the WordPress Environment and Template
      */
      define('WP_USE_THEMES', true);
      require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );
  }
  </code></pre>