所以我尝试添加一个命令与工匠:“找不到命令”
php artisan command:make MailSendCommand
MailSendCommand.php被创建的文件。 我把它编辑成这样:
class MailSendCommand extends Command {
protected $name = 'command:send-mail';
protected $description = 'Send mails to the users.';
public function __construct()
{
parent::__construct();
}
public function fire()
{
$this->info('Befehl wird ausgeführt');
}
...
在我的文件中开始/ artisan.php我加
Artisan::add(new MailSendCommand);
,但是当我输入 'PHP的工匠命令:发送邮件' 它说:
Command "command:send-mail" is not defined.
这只是工作我的家用电脑(XAMPP)上,但不是我的活的服务器(PHP 5.5.15(CGI-FCGI))
上'php artisan clear:cache'和'php artisan dump-autoload'没有帮助。