【问题标题】:Getting Command "make:entity" is not defined. error in Lumen 5.8 with l5-repository package获取命令“make:entity”未定义。带有 l5-repository 包的 Lumen 5.8 中的错误
【发布时间】:2020-09-03 10:25:33
【问题描述】:

我已经安装了 Lumen 5.8 和 l5-repository。 这是我在 composer.json 中的需求列表:

"require": {
        "php": ">=7.1.3",
        "firebase/php-jwt": "^5.2",
        "laravel/lumen-framework": "5.8.*",
        "laravelista/lumen-vendor-publish": "^5.8",
        "league/fractal": "^0.19.2",
        "prettus/l5-repository": "2.1.*",
        "prettus/laravel-validation": "^1.2",
        "robclancy/presenter": "^1.4"
    }

我已按照l5-repository中提供的说明进行操作

在 bootstrap/app.php 中放置:

$app->register(Prettus\Repository\Providers\LumenRepositoryServiceProvider::class);

但是通过以下命令发布后:

php artisan vendor:publish --provider "Prettus\Repository\Providers\RepositoryServiceProvider"

app/config目录下没有生成文件

然后在运行命令之后

php artisan make:entity Post

显示以下错误:

  Command "make:entity" is not defined.  

  Did you mean one of these?             
      make:migration                     
      make:repository                    
      make:seeder 

要查看命令列表,我尝试了“php artisan”命令并发现以下结果:

Laravel Framework Lumen (5.8.12) (Laravel Components 5.8.*)

Usage:
  command [options] [arguments]

Available commands:
  help                Displays help for a command
  list                Lists commands
  migrate             Run the database migrations
 auth
  auth:clear-resets   Flush expired password reset tokens
 cache
  cache:clear         Flush the application cache
  cache:forget        Remove an item from the 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:repository     Create a new repository.
  make:seeder         Create a new seeder class
 migrate
  migrate:fresh       Drop all tables and re-run all migrations
  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:table         Create a migration for the queue jobs database table
  queue:work          Start processing jobs on the queue as a daemon
 schedule
  schedule:run        Run the scheduled commands
 vendor
  vendor:publish      Publish any publishable assets from vendor packages

有没有人遇到过这个问题并得到了解决方案?

【问题讨论】:

    标签: php lumen lumen-5.8


    【解决方案1】:

    今天早上我收到了同样的消息。我正在使用带有 EasyAdmin 3 的 Symfony 5.1.2。 执行composer update 更新了一些东西,但问题仍然存在。 我检查了.env.local,它被设置为prod,而不是dev。把它放回dev 对我来说是个窍门。

    【讨论】:

    • 记得点赞与您相关的问题!这将增加有人回答它的机会!
    猜你喜欢
    • 2016-10-22
    • 2016-07-16
    • 2020-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-15
    • 2017-10-25
    • 1970-01-01
    相关资源
    最近更新 更多