【发布时间】:2016-07-24 21:09:46
【问题描述】:
这是我的 UserCreateCommand.php 文件,当命令:- php artisan user-create username password 出现如下错误:- [Symfony\Component\Console\Exception\RuntimeException] 参数太多。
class UserCreateCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'user-create';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Create user with password imediately';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//
$username=$this->argument('username');
$password=$this->argument('password');
$user= new UserDemo();
$user->username=$username;
$user->password=Hash::make($password);
$user->save();
$this->info('user has been cretaed');
}
}
【问题讨论】:
-
命令出错:php artisan user-create username password
标签: laravel laravel-5.2