Lumen Console Commands

Source: Internet
Author: User

1. New class inheritance in App->console->commands Illuminate\console\command

<?php namespace App\console\commands; UseIlluminate\console\command;classTestcommandextendscommand{/** * Command line execution command * @var string*/    protected $signature= ' Test_command '; /** * Command Description * * @var string*/    protected $description= ' Command description '; /** * Create a new command instance. * * @return void*/     Public function__construct () {Parent::__construct (); }     /** * Execute the console command. * * @return Mixed*/     Public functionhandle () {//write the actions that need to be performed here    }}

2. Add the current command class to the Commands array in app->console->kernel.php Testcommand::class

protected $commands = [    testcommand::class,];

3. View commands

PHP Artisan List

4 Execute Test_command command

PHP Artisan Test_command

Lumen Console Commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.