Last active
August 29, 2015 14:22
-
-
Save adis-me/c4eadbebc56c3528fd0b to your computer and use it in GitHub Desktop.
Setting APP_KEY for Laravel Lumen Framework via routes.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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