Created
March 3, 2019 16:39
-
-
Save devig/14cff4c3762376c7ff0f3cfbd05f74f8 to your computer and use it in GitHub Desktop.
laravel artisan make:command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//php artisan make:command Price | |
//php artisan price:update p1 param2 array_param1 array_param2 --queue | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
class Price extends Command | |
{ | |
protected $signature = 'price:update {param1} {param2} {array_param*} {--queue}'; //--queue не выводит // {optional?} | |
protected $description = 'Update price'; | |
public function __construct() | |
{ | |
parent::__construct(); | |
} | |
public function handle() | |
{ | |
$param1 = $this->argument('param1'); | |
$param2 = $this->argument('param2'); | |
$arguments = $this->arguments(); | |
print_r($arguments); | |
//echo "price updated {$param1} {$param2}!"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment