LaravelにTelescopeを導入したい。
https://laravel.com/docs/9.x/telescope
基本的にこの通りにやればいいのだが、記載されていないエラーがでた。
手順
いつも通りに、/var/www に移動。
Laravel
composer require laravel/telescope --dev
Laravel
php artisan telescope:install
// ここでエラーでる
ERROR There are no commands defined in the “telescope” namespace.
ので
config/app.phpの’providersに下記を追加
config/app.php
'providers' => [
// ・・・
Laravel\Telescope\TelescopeServiceProvider::class,
]
その後、再度
Laravel
php artisan telescope:install
とすると
Publishing Telescope Service Provider…
Publishing Telescope Assets…
Publishing Telescope Configuration…
Telescope scaffolding installed successfully.
と成功メッセージが表示される。
最後にマイグレーションも忘れずに
Laravel
php artisan migrate
これでつかえるようになります。