laravel 使用 artisan 创建 UserController.php 失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23749874/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 09:32:26  来源:igfitidea点击:

Creating UserController.php with artisan is failing

phplaravellaravel-4

提问by sparecycle

Following along with Learning Laravel 4 Application Development - Hardik Danger.

跟随学习 Laravel 4 应用程序开发 - Hardik Danger

I attempt to create my first controller with artisan by doing the following:

我尝试通过执行以下操作来使用 artisan 创建我的第一个控制器:

php artisan Usercontroller:make users

And I get an error:

我收到一个错误:

  [InvalidArgumentException]                                        
  There are no commands defined in the "Usercontroller" namespace.  

  Did you mean this?                                                
      controller 

What is happening here?

这里发生了什么?

回答by Raj Sharma

Laravel 5

Laravel 5

php artisan make:controller UsersController

回答by dvabr

The correct command should be:

正确的命令应该是:

php artisan controller:make UsersController

回答by user3734651

or try

或尝试

php artisan make:controller UsersController