2016-08-22 50 views
0

我试图使用make:console创建一个调度程序,但它的返回:化妆:命令不Laravel定义5.1.7

[InvalidArgumentException]    
    Command "make:console" is not defined. 
    Did you mean one of these?  
    make:seeder       
    make:migration 

不够公平,如果这是5.0版本之前,但我目前使用5.1.7。什么可能导致这个问题?

下面是当前可用的命令列表:

help    Displays help for a command 
    list    Lists commands 
    migrate    Run the database migrations 
    serve    Serve the application on the PHP development server 
cache 
    cache:clear   Flush the application cache 
    cache:table   Create a migration for the cache database table 
db 
    db:seed    Seed the database with records 
make 
    make:migration  Create a new migration file 
    make:seeder   Create a new seeder class 
migrate 
    migrate:install  Create the migration repository 
    migrate:refresh  Reset and re-run all migrations 
    migrate:reset  Rollback all database migrations 
    migrate:rollback Rollback the last database migration 
    migrate:status  Show the status of each migration 
queue 
    queue:failed  List all of the failed queue jobs 
    queue:failed-table Create a migration for the failed queue jobs database table 
    queue:flush   Flush all of the failed queue jobs 
    queue:forget  Delete a failed queue job 
    queue:listen  Listen to a given queue 
    queue:restart  Restart queue worker daemons after their current job 
    queue:retry   Retry a failed queue job 
    queue:subscribe  Subscribe a URL to an Iron.io push queue 
    queue:table   Create a migration for the queue jobs database table 
    queue:work   Process the next job on a queue 
schedule 
    schedule:run  Run the scheduled commands 

如果我修改composer.json至5.2版本*我收到命令的甚至更薄的选择:

help    Displays help for a command 
    list    Lists commands 
    migrate   Run the database migrations 
cache 
    cache:clear  Flush the application cache 
db 
    db:seed   Seed the database with records 
make 
    make:migration Create a new migration file 
migrate 
    migrate:install Create the migration repository 
    migrate:refresh Reset and re-run all migrations 
    migrate:reset  Rollback all database migrations 
    migrate:rollback Rollback the last database migration 
    migrate:status Show the status of each migration 
queue 
    queue:failed  List all of the failed queue jobs 
    queue:flush  Flush all of the failed queue jobs 
    queue:forget  Delete a failed queue job 
    queue:listen  Listen to a given queue 
    queue:restart  Restart queue worker daemons after their current job 
    queue:retry  Retry a failed queue job 
    queue:work  Process the next job on a queue 
schedule 
    schedule:run  Run the scheduled commands 
+2

你'make'命令选项似乎严重不足。没有'controller','model'等选项。请检查您的laravel安装是否有错误。 – linuxartisan

+0

也许尝试运行'composer update'。正如@linuxartisan暗示你缺少一些**应该在那里的命令。 – James

+0

是的,我也注意到了。运行'composer update'更新了许多照明组件,但是我仍然遇到同样的问题。 – Jake

回答

1

我找到了工作 - 周围。尽管我的Laravel CLI缺少前面提到的命令,但我仍然有计划和命令文件结构来操作。

Commands目录中手动创建example_scheduled_command.php并将其注册在Kernal.php中。然后你可以利用Laravel Scheduling。