将 telescope 与流明一起使用

Using telescope with lumen

我尝试了 https://github.com/laravel/telescope 中的命令:

composer require laravel/telescope --dev

php artisan telescope:install

该命令导致以下错误:

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

尝试通过 composer update 更新依赖项,但问题仍然存在。

composer update

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 29 updates, 0 removals
  - Updating illuminate/contracts (v5.7.9 => v5.7.10): Loading from cache
  - Updating illuminate/support (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/filesystem (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/session (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/pipeline (v5.7.9 => v5.7.10): Loading from cache
  - Updating illuminate/http (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/container (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/routing (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/events (v5.7.9 => v5.7.10): Loading from cache
  - Updating illuminate/view (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/translation (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/validation (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/database (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/console (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/queue (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating illuminate/pagination (v5.7.9 => v5.7.10): Loading from cache
  - Updating illuminate/log (v5.7.9 => v5.7.10): Loading from cache
  - Updating illuminate/hashing (v5.7.9 => v5.7.10): Loading from cache
  - Updating illuminate/config (v5.7.9 => v5.7.10): Loading from cache
  - Updating illuminate/cache (v5.7.9 => v5.7.10): Loading from cache
  - Updating illuminate/bus (v5.7.9 => v5.7.10): Loading from cache
  - Updating illuminate/broadcasting (v5.7.9 => v5.7.10): Loading from cache
  - Updating illuminate/auth (v5.7.9 => v5.7.10): Downloading (100%)
  - Updating laravel/lumen-framework (v5.7.1 => v5.7.2): Downloading (100%)
  - Updating phpunit/php-code-coverage (6.0.8 => 6.1.3): Downloading (100%)
  - Updating phpunit/phpunit (7.4.0 => 7.4.3): Downloading (100%)
  - Updating aws/aws-sdk-php (3.69.4 => 3.69.13): Downloading (100%)
  - Updating league/flysystem (1.0.47 => 1.0.48): Downloading (100%)
Writing lock file
Generating optimized autoload files



php artisan telescope:install


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

这是否意味着我们需要等到 laravel/lumen-framework v5.7.7+ 才能使用 telescope with lumen?

首先:不需要传送命名空间。您始终可以在 bootstrap/app.php 中注册服务提供商。 但这不是问题。我注册了提供商并收到此错误消息

Call to undefined method Laravel\Lumen\Routing\Router::middlewareGroup().

Lumen 的路由器 class 与 Laravel 的不兼容。唯一的解决方案是获取代码,创建一个分支并将 "translate" Laravel 函数放入 Lumen 中。

根据 Mohamed Said(一位 laravel 开发人员)的评论:

Telescope 尚未针对 lumen 进行适配。

请参考github问题:https://github.com/laravel/telescope/issues/112