使用artisan - laravel 4创建控制器时出错


Error in creating controller using artisan - laravel 4

我试图使用此命令创建控制器:php artisan controller:make CupcakesController,但我收到此错误:

{
    "error": {
        "type": "ErrorException",
        "message": "include('/opt'/lampp'/htdocs'/cupcakes-lara'/app'/controllers'/CupcakesController.php): failed to open stream: No such file or directory",
        "file": "'/opt'/lampp'/htdocs'/cupcakes-lara'/vendor'/composer'/ClassLoader.php",
        "line": 185
    }
}

这有什么问题?

如果你在routes.php中创建了一个指向不存在的控制器的路由,然后试图使用Artisan来创建该控制器,就会产生这个错误。注释掉路由,然后再试一次:)

那是generator,不是artisan?

php artisan generate:controller CupcakesController