Lumen 5.4 尝试安装 Entrust 错误““供应商”命名空间中没有定义命令”

问题描述 投票:0回答:2

我尝试使用 Lumen 5.4 安装,但我不断收到此错误

There are no commands defined in the "vendor" namespace.

我已采取的步骤

1)将

"zizaco/entrust": "5.2.x-dev"
添加到composer.json

2) 也添加

$app->register(Zizaco\Entrust\EntrustServiceProvider::class);
app.php

3)

composer update

4)创建这个helpers.php 文件

if ( ! function_exists('config_path'))
{
    /**
     * Get the configuration path.
     *
     * @param  string $path
     * @return string
     */
    function config_path($path = '')
    {
        return app()->basePath() . '/config' . ($path ? '/' . $path : $path);
    }
}

5)将其添加到composer.json

    "autoload": {
        "files": [
            "app/helpers.php"
        ]
    }

6) 在EntrustServiceProvider.php

中注释掉
//$this->bladeDirectives();

7)将发布功能更改为

    $this->publishes([
        -            __DIR__.'/../config/config.php' => config_path('entrust.php'),
        +            __DIR__.'/../config/config.php' => app()->basePath() . '/config/entrust.php',
    ]);

8)

composer dump-autoload -o

9)

php artisan vendor:publish

错误

Fatal error: Call to undefined function Zizaco\Entrust\config_path() in /Users/API/vendor/zizaco/entrust/src/Entrust/EntrustServiceProvider.php on line 31


  [Symfony\Component\Debug\Exception\FatalErrorException]  
  Call to undefined function Zizaco\Entrust\config_path()  
laravel lumen
2个回答
2
投票

通过安装此软件包并安装 entrust 修复了错误

https://github.com/irazasyed/larasupport


0
投票

查看您的配置 pp.php。可能是您没有在 'providers' 键处注册 Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class 。

© www.soinside.com 2019 - 2024. All rights reserved.