Lumen Micro Framework => php artisan key:generate

后端 未结 12 853
遥遥无期
遥遥无期 2021-01-30 00:59

I\'m trying out the PHP micro Framework Lumen (from Laravel).

One of my first steps was to look into the .env.example file and make a copy of it to have my

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-30 01:36

    Firstly, you have to register your key generator command, put this Lumen Key Generator Commands to app/Console/Commands/KeyGenerateCommand.php. To make this command available in artisan, change app\Console\Kernel.php:

    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        'App\Console\Commands\KeyGenerateCommand',
    ];
    

    After that, configure your application so that Illuminate\Config\Repository instance has app.key value. To do this, change bootstrap/app.php:

    configure('app');
    

    After that, copy your .env.example file to .env:

    cp .env.example .env
    

    Ignore this step if you already use .env file.

    Enjoy you key:generate command via:

    php artisan key:generate
    

    Edit

    You may use Lumen Generator. It covers so much commands you are missing from Laravel.

提交回复
热议问题