Answers for "laravel console command arguments"

PHP
2

artisan make command

php artisan make:command CommandName
Posted by: Guest on June-03-2020
0

create command laravel sample parameter

// 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.
       
     }
Posted by: Guest on September-17-2021

Code answers related to "laravel console command arguments"

Browse Popular Code Answers by Language