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

时间:2017-06-16 01:55:03

标签: laravel lumen

我正在尝试使用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()  

1 个答案:

答案 0 :(得分:0)

通过安装此软件包而不是安装委托来修复错误

https://github.com/irazasyed/larasupport