//--------------------------------------------------------------------------
// Try To Register Again The Config Manager
//--------------------------------------------------------------------------
use Config\Repository as ConfigRepository;
use Support\Facades\Facade;
if (CONFIG_STORE == 'database') {
    // Get the Database Connection instance.
    $connection = $app['db']->connection();
    // Get a fresh Config Loader instance.
    $loader = $app->getConfigLoader();
    // Setup Database Connection instance.
    $loader->setConnection($connection);
    // Refresh the Application's Config instance.
    $app->instance('config', $config = new ConfigRepository($loader));
    // Make the Facade to refresh its information.
    Facade::clearResolvedInstance('config');
} else {
    if (CONFIG_STORE != 'files') {
        throw new \InvalidArgumentException('Invalid Config Store type.');
    }
}
//--------------------------------------------------------------------------
// Start the Legacy Session
//--------------------------------------------------------------------------
use Helpers\Session as LegacySession;
LegacySession::init();
//--------------------------------------------------------------------------
// Boot Stage Customization
//--------------------------------------------------------------------------
/**
 * Create a constant for the URL of the site.
 /**
  * Refresh the bound request instance in the container.
  *
  * @param  \Http\Request  $request
  * @return void
  */
 protected function refreshRequest(Request $request)
 {
     $this->instance('request', $request);
     Facade::clearResolvedInstance('request');
 }