Lumen make:command

前端 未结 3 792
遇见更好的自我
遇见更好的自我 2020-12-24 13:34

I\'m trying to execute code within my Lumen install via the command line. In full Laravel , I\'ve read that you can use commands to achieve this via \"make:command\", but Lu

3条回答
  •  星月不相逢
    2020-12-24 13:59

    Here is a template for a new command. You can just copy and paste this in to a new file and start working. I tested it on lumen 5.7.0

    info('hello world.');
        }
    }
    

    Then register it on the Kernel.php file.

    /**
    * The Artisan commands provided by your application.
    *
    * @var array
    */
    protected $commands = [
       \App\Console\Commands\CommandName::class
    ];
    

提交回复
热议问题