Skip to content

Telescope

Clio Brichaut edited this page Jan 14, 2023 · 1 revision

What is it?

"Laravel Telescope makes a wonderful companion to your local Laravel development environment. Telescope provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps, and more." [source]

Setup

  1. Install the package with ./vendor/bin/sail composer require laravel/telescope --dev (in wsl terminal) or composer require laravel/telescope --dev (in the php container).

  2. Run ./vendor/bin/sail artisan telescope:install.

  3. In /app/config/app.php, remove the TelescopeServiceProvider added during the installation and register it in /app/app/Providers/AppServiceProvider.php instead, with:

class AppServiceProvider extends ServiceProvider
{
	/**
	 * Register any application services.
	 *
	 * @return void
	 */
	public function register()
	{
		if ($this->app->environment('local'))
		{
			$this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
			$this->app->register(TelescopeServiceProvider::class);
		}
	}
}
  1. Prevent Telescope from being auto-discovered by adding it to the list in /app/composer.json:
"extra": {
  "laravel": {
    "dont-discover": [
      "laravel/telescope"
    ]
  1. Run ./vendor/bin/sail artisan migrate.

Usage

Open http://localhost/telescope to use the interface.

Clone this wiki locally