📜  创建命令 laravel 示例参数 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:01.690000             🧑  作者: Mango

代码示例1
// 1
protected $signature = 'add:itemstocat {keyword} {category_id}';
// 2
public function handle()
 {
     if ($this->confirm('This will run the command code continue?')) {
         // Do something here.
        $keyword = $this->argument('keyword');
        $category_id = $this->argument('category_id');
         // Do something here.
       
     }