欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          聊聊?laravel怎么用命令來執(zhí)行腳本

          下面由Laravel教程欄目帶大家介紹laravel怎么用命令來執(zhí)行腳本,希望對大家有所幫助!

          laravel 使用命令執(zhí)行腳本

          1.生成console文件

           php artisan make:console TestConsole --command=laravel:test

          2.handle方法中編輯業(yè)務邏輯

          <?php namespace AppConsoleCommands; use IlluminateConsoleCommand; class HelloLaravelAcademy extends Command {     /**      * The name and signature of the console command.      *      * @var string      */     protected $signature = 'laravel:test {name?}';     /**      * The console 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 function handle()     {         echo $this->argument("name").PHP_EOL;         echo 123;     } }

          $signature為是否接收參數(shù),?表示非必須。 arguement接收參數(shù)

          執(zhí)行

           php artisan laravel:test    php artisan laravel:test xiaoming

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號