When I use Option Shortcuts in my artisan console $signature锛宨t tips like below
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class BaiduPush extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'baidu:push {id?} {--L|limit=2000}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Push the url to Baidu Webmaster';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
dd($this->options());
}
}
run php artisan baidu:push --L=2000, output:
[Symfony\Component\Console\Exception\RuntimeException]
The "--L" option does not exist.
but the offical document show this method
link https://laravel.com/docs/5.4/artisan#registering-commands (see section Option Shortcuts )
should be php artisan baidu:push -L=2000
@themsaid
Thank you very much.
-L=2000 not --L=2000, now its work now.
but the official documentation does not mention that.
Hope will be mentioned in the official documentation
@fbens it won't be mentioned unless you make PR to docs next time.
Actually it won't be mentioned anyway :D
Looks like people are supposed to know everything about Symfony Console while reading docs about Artisan
Yes, same with: php artisan migrate -鈥揹atabase=sqlite_testing
No need for '=' sign in the option values either, they will get included in $this->option('key'). I would use the following:
php artisan baidu:push -L 2000
Most helpful comment
Looks like people are supposed to know everything about Symfony Console while reading docs about Artisan