telescope 的服务提供者 – 永夜 https://www.shuijingwanwq.com 没有不值得去解决的问题,也没有不值得去学习的技术! Sun, 04 Feb 2024 01:37:18 +0000 zh-Hans hourly 1 https://wordpress.org/?v=7.0 在 Laravel 9 中,执行:php artisan telescope:install 时报错:ERROR There are no commands defined in the “telescope” namespace. https://www.shuijingwanwq.com/2024/02/04/8431/ https://www.shuijingwanwq.com/2024/02/04/8431/#respond Sun, 04 Feb 2024 01:36:44 +0000 https://www.shuijingwanwq.com/?p=8431 浏览量: 97 1、在 Laravel 9 中,执行:php artisan telescope:install 时报错:ERROR There are no commands defined in the “telescope” namespace.。如图1
在 Laravel 9 中,执行:php artisan telescope:install 时报错:ERROR There are no commands defined in the "telescope" namespace.

图1



PS E:\wwwroot\erp-backend> php artisan telescope:install

   ERROR  There are no commands defined in the "telescope" namespace.



2、发现应用程序的 config/app.php 配置文件中 TelescopeServiceProvider 服务提供者注册 已经删除。先再次添加回去。如图2
发现应用程序的 config/app.php 配置文件中 TelescopeServiceProvider 服务提供者注册 已经删除。先再次添加回去

图2

3、再次运行:php artisan telescope:install。不再报错。如图3
再次运行:php artisan telescope:install。不再报错

图3



PS E:\wwwroot\erp-backend> php artisan telescope:install
Publishing Telescope Service Provider...
Publishing Telescope Assets...
Publishing Telescope Configuration...
Telescope scaffolding installed successfully.


4、还原第 2 步骤的操作,在 App\Providers\AppServiceProvider 类的 register 方法中,手动注册 telescope 的服务提供者


/**
 * 注册应用服务
 *
 * @return void
 */
public function register()
{
    if ($this->app->environment('local')) {
        $this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
        $this->app->register(TelescopeServiceProvider::class);
    }
}


]]>
https://www.shuijingwanwq.com/2024/02/04/8431/feed/ 0