【问题标题】:Lumen - Missing commands流明 - 缺少命令
【发布时间】:2016-07-04 23:38:39
【问题描述】:

我在运行 Lumen's Artisan 时遇到问题。缺少大部分命令。

例如,如果我写 php artisan routes,我会收到以下错误:命令“路由”未定义。

下面是我通过输入 php artisan 得到的输出示例。

Laravel Framework version Lumen (5.2.5) (Laravel Components 5.2.*)

Usage:
command [options] [arguments]

Options:
-h, --help            Display this help message
-q, --quiet           Do not output any message
-V, --version         Display this application version
  --ansi            Force ANSI output
  --no-ansi         Disable ANSI output
-n, --no-interaction  Do not ask any interactive question
  --env[=ENV]       The environment the command should run under.
-v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
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

有人知道如何解决这个问题吗?

【问题讨论】:

  • 你为什么不说你使用 Lumen 而不是 Laravel stackoverflow.com/questions/36077692/…
  • 虽然不是完全相同的副本。一个有效的答案是here
  • @AlexeyMezenin 抱歉。那么我该如何修复流明中缺少的命令
  • @MansoorH 我上面提供的链接将为您提供有关如何添加命令的答案。如果需要,您必须自己创建它们。流明不与他们一起出现。如果你想要一个功能齐全的框架,你应该使用 Laravel 而不是 Lumen。

标签: laravel laravel-5 laravel-artisan lumen lumen-5.2


【解决方案1】:

Lumen 本身不支持route 命令。但是,在 Laravel 中,您可以执行以下操作:

使用php artisan list 显示所有命令。

您尝试使用的命令应该是php artisan route:list

【讨论】:

  • 它显示错误,如` [Symfony\Component\Console\Exception\CommandNotFoundException] "route" 命名空间中没有定义命令。`
  • Lumen 不支持route 命令,只有 Laravel 支持。
【解决方案2】:

您需要使用 Laravel 或手动创建命令或使用类似于 Lumen Route List 的包。

【讨论】:

  • 它的节目PHP Fatal error: Class 'Dotenv' not found in /var/www/html/lumen/bootstrap/app.php on line 5
猜你喜欢
  • 2013-07-11
  • 2015-07-26
  • 1970-01-01
  • 2015-04-17
  • 1970-01-01
  • 2016-01-20
  • 2016-10-28
  • 2019-01-12
  • 2011-09-20
相关资源
最近更新 更多