src/Mcamara/LaravelLocalization/Commands/RouteTranslationsCacheCommand.php
protected function getFreshApplicationRoutes($locale = null)
    {
        $app = require $this->getBootstrapPath() . '/app.php';

        if (null !== $locale) {

            $key = LaravelLocalization::ENV_ROUTE_KEY;

            putenv("{$key}={$locale}");

            $app->make(Kernel::class)->bootstrap();

            putenv("{$key}=");

        } else {

            $app->make(Kernel::class)->bootstrap();
        }

        return $app['router']->getRoutes();
    }
protected function getFreshApplicationRoutes($locale = null)
    {
        $app = require $this->getBootstrapPath() . '/app.php';

        if (null !== $locale) {

            $key = LaravelLocalization::ENV_ROUTE_KEY;

            putenv("{$key}={$locale}");

            $app->make(Kernel::class)->bootstrap();

            putenv("{$key}=");

        } else {

            $app->make(Kernel::class)->bootstrap();
        }

        return $app['router']->getRoutes();
    }
Boot a fresh copy of the application and get the routes.

@param string|null $locale
@return \Illuminate\Routing\RouteCollection