我在控制器中有这个代码:
use Larabook\Registration\RegistrUserCommand;
use Laracasts\Commander\CommandBus;
public function store()
{
extract(Input::only('username','email','password'));
$command = new RegisterUserCommand($username, $email, $password);
$this->commandBus->execute($command);
在app / Larabook / Registration / RegisterUserCommand中我有:
<?php namespace Larabook\Registration;
class RegisterUserCommand {
public $username;
public $email;
public $password;
function __construct($username,$email, $password)
{
$this->email = $email;
$this->password = $password;
$this->username = $username;
}
}
当我跑步时,我找不到Class'RegisterUserCommand'。
答案 0 :(得分:1)
您的use
声明中有一个拼写错误。变化:
use Larabook\Registration\RegistrUserCommand;
到
use Larabook\Registration\RegisterUserCommand;