Lumen 5.4 尝试安装 Entrust 错误 "There are no commands defined in the "vendor“namespace”
Lumen 5.4 Trying to install Entrust error "There are no commands defined in the "vendor" namespace"
我正在尝试使用 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()
通过安装此包而不是安装 entrust 修复了错误
我正在尝试使用 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()
通过安装此包而不是安装 entrust 修复了错误