Generating application key in Lumen

To generate application key in Lumen , please add your routes/web.php and point your domain to /key and copy the output string and paste it in your .env file

$app->get('/key', function() {
    return str_random(32);
});
In Lumen 5.5
$router->get('/key', function() {
    return str_random(32);
});

Usage:

APP_KEY=Your_Random_String

Leave a Reply

Your email address will not be published. Required fields are marked *