Skip to content

Instantly share code, notes, and snippets.

@adis-me
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save adis-me/c4eadbebc56c3528fd0b to your computer and use it in GitHub Desktop.

Select an option

Save adis-me/c4eadbebc56c3528fd0b to your computer and use it in GitHub Desktop.
Setting APP_KEY for Laravel Lumen Framework via routes.php
// First we need to load the Dotenv, you could also do this via bootstrap/app.php
\Dotenv::load(__DIR__.'/../../');
// call <url>/k
$app->get('/k', function() use ($app) {
$path = base_path('.env');
if (file_exists($path))
{
file_put_contents($path, str_replace(
env('APP_KEY'), str_random(32), file_get_contents($path)
));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment