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