A toolbar for Laravel Telescope, based on the Symfony Web Profiler.

Overview

Laravel Telescope Toolbar

Packagist License Latest Stable Version Total Downloads

Extends Laravel Telescope to show a powerful Toolbar

See https://github.com/laravel/telescope

Install

First install Telescope and check it works (see https://laravel.com/docs/master/telescope)

composer require laravel/telescope
php artisan telescope:install
php artisan migrate

Then just install the package with Composer and it will register automatically:

composer require fruitcake/laravel-telescope-toolbar --dev

The Toolbar will show by default when Telescope is enabled and APP_DEBUG is true.

image

Note: The Toolbar is intended for Development environments, not for production.

Publishing the config

Run this command to publish the config for this package:

php artisan vendor:publish --provider="Fruitcake\\TelescopeToolbar\\ToolbarServiceProvider"

Current Features

  • Inject Toolbar for quick info
  • Show redirects and Ajax Requests
  • Link to related Telescope Entry page
  • Show up to 5 entries for collectors, link to details
  • Supported Collectors:
    • Request info / timing
    • User auth
    • Database queries
    • Laravel/php version
    • Cache hit/miss/set
    • Logger entries
    • Exceptions
    • Mails
    • Notifications
    • Jobs
    • Dumps (when watching the Dump screen, or using debug(...$args))
    • Number of entries for: Commands/Models/Events

Screenshots

Ajax/ Redirects stack:

image

Preview for Exceptions/Mail/Notifications/Log entries with link to details:

image

Counter for Queries (and Cache etc):

image

Catch debug()/Toolbar::dump() calls and show them directly in the Toolbar instead of the page:

image

License and attribution

Laravel Telescope Toolbar is open-sourced software licensed under the MIT license.

Based on Symfony Web Profiler and Laravel Telescope

The styling, javascript, some icons and html of the Toolbar and (part of) its Collectors are based on the Symfony Web Profiler. JS/CSS is mostly copied and converted to Blade syntax. Collectors are modified to show Laravel data. See https://github.com/symfony/web-profiler-bundle - Copyright (c) 2004-2019 Fabien Potencier

Data from collectors is provided by Laravel Telescope. Some styling/icons/logic are alse re-used. See https://github.com/laravel/telescope - Copyright (c) Taylor Otwell

Comments
  • Initial ajax request not shown

    Initial ajax request not shown

    My application loads an app.js file that does an axios request for it's data just before the </body> tag. This initial ajax request is not being shown in the toolbar. Figured it's because the toolbar is loaded after the app.js file. When changing the toolbar to load just before the </head> the initial ajax request is being show.

    I guess there are reasons to not load the toolbar in the head section? I've tried loading it based on: <!-- toolbar --> just before loading the app.js file and that works. Would it be an idea to make the place where the toolbar is injected configurable in Toolbar@injectToolbar?

    If you like the idea I can create a PR for it.

    opened by arjanwestdorp 12
  • Applied a Laravel Telescope theme to the toolbar

    Applied a Laravel Telescope theme to the toolbar

    Hello,

    I applied a Laravel Telescope theme to the toolbar, I thought it made sense because you use Telescope under the hood.

    Hope you like it and if you any suggestions please let me know.

    If you like it maybe you can make a new image for in the readme, I don’t have a big project running for all features at the moment.

    Issue #5

    opened by GertjanRoke 10
  • Missing Icons

    Missing Icons

    Hello, I recently updated the toolbar version I'm using to 1.2, (on Laravel 6.16.0) - none of the icons appear to be showing in the toolbar:

    image

    I've tried removing / re-requiring through composer, didn't make a difference.

    Any help would be appreciated, thanks!

    opened by JonPurvis 7
  • Assets not loading / breaking Safari

    Assets not loading / breaking Safari

    All toolbar routes currently use the telescope middleware stack, which might include the auth middleware.

    This causes errors in Safari if the user isn't logged in:

    [Error] SyntaxError: Unexpected token '<'
    	(anonymous function) (login:1)
    [Error] Did not parse stylesheet at 'https://mercatus.test/_tt/assets/styling.css?20190826&lightMode=1' because non CSS MIME types are not allowed in strict mode.
    [Error] ReferenceError: Can't find variable: Sfjs
    	(anonymous function) (mercatus.test:14)
    	Global Code (mercatus.test:15)
    [Error] ReferenceError: Can't find variable: Sfjs
    	(anonymous function) (mercatus.test:79)
    	Global Code (mercatus.test:80)
    
    opened by tillkruss 6
  • Don't load Toolbar on some paths

    Don't load Toolbar on some paths

    Telescope itself has the ability to ignore some paths (for example, a third-party package that has its own routes). Is this something we can have for the Toolbar too?

    Currently, the Toolbar will be injected into any HTML response. However, it isn't too intelligent as to which responses are actually HTML. If a header wasn't supplied, it is assumed that the response is HTML.

    opened by mikemand 5
  • Error when query time is above 999 ms

    Error when query time is above 999 ms

    • PHP: v7.3.1
    • Laravel: v7.1.3
    • Telescope: v3.1.1
    • Telescope Toolbar: v1.2.2

    Hi,

    I have a query that takes around 5247.76 ms. For this reason, I wanted to see if I can optimize it using this toolbar.

    The toolbar was unfortunately showing the following error message:

    An 500 error occurred while loading the Telescope Toolbar. Make sure you configured/installed Telescope correctly.
    

    When I looked into the response of the made request by this toolbar, I saw the following error (shortened):

    "message": "A non well formed numeric value encountered (View: /home/vagrant/GitHub/eloquent-viewable-demo-app/vendor/fruitcake/laravel-telescope-toolbar/resources/views/collectors/queries.blade.php)",
        "exception": "Facade\\Ignition\\Exceptions\\ViewException",
        "file": "/home/vagrant/GitHub/eloquent-viewable-demo-app/vendor/fruitcake/laravel-telescope-toolbar/src/../resources/views/collectors/queries.blade.php",
        "line": 21,
    

    Line 21:

    $query_time += $query->content['time'] ?? 0;
    

    I decided to look at the value of $query->content['time'] and it returned 5,247.76.

    This is where the problem lays. PHP can't cast it, because it doesn't understand the format.

    Looking into the source code of Telescope, I saw this line in the QueryWatcher:

    'time' => number_format($time, 2),
    

    I'm currently thinking about a solution but it may take a while.

    Thanks for creating and maintaining this package!

    opened by cyrildewit 4
  • Release for PHP 8 support

    Release for PHP 8 support

    In #49 PHP 8 support was added, but there was no release since then so with the current version composer will give the following error:

        - fruitcake/laravel-telescope-toolbar v1.3.0 requires php ^7.3 -> your php version (8.0.3) does not satisfy that requirement.
    

    I temporarily switched to dev-master in my composer.json, but I propose to release a new version which includes this support.

    opened by laurensgroeneveld 2
  • Features / todo

    Features / todo

    Some ideas:

    • View collector -> As soon as https://github.com/laravel/telescope/pull/679 is tagged
    • ~~Toggle the ajax listener with localstorage on/off instead of config? (Eg. pause/resume button next to 'Clear')~~
    • ~~Click to load Ajax requests in the toolbar, instead of directly on the profiler (eg. call Sfjs.loadToolbar(token) instead of opening Telescope.~~
    • ...
    enhancement 
    opened by barryvdh 2
  • Make toolbar route path configurable

    Make toolbar route path configurable

    This will allow to configure the route path at which the toolbar is available. This will avoid conflicts with application that already use this route or which are unable to the default.

    opened by arjanwestdorp 2
  • Add auto night theme

    Add auto night theme

    I added 'auto' option for the light theme option in config so it imports both of css files that styles light and dark mode so that toolbar should automatically detect if the user has requested a light or dark theme based on the operating system's or browser's settings.

    opened by joowdx 1
  • Introduce the ability to include requests for paths.

    Introduce the ability to include requests for paths.

    I was experiencing an issue where some of my requests didn't have profiles I could load, so I decided to introduce a config setting for including paths.

    I'm unsure if there is a more preferable way this could have been implemented, but it does work for my situation and I think it'd be a good addition to this tool.

    opened by Favorlock 1
  • stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated

    stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated

    Laravel deprecation warning:

    storage/logs/php-deprecation-warnings.log:84:[2022-10-16 14:53:13] local.WARNING: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/vendor/fruitcake/laravel-telescope-toolbar/src/Toolbar.php on line 93
    

    on:

        /**
         * @param \Illuminate\Http\Request $request A Request instance
         * @param \Symfony\Component\HttpFoundation\Response $response A Response instance
         */
        public function modifyResponse($request, $response)
        {
            //
            // Skip non-html requests
            if (($response->headers->has('Content-Type') && strpos($response->headers->get('Content-Type'), 'html') === false)
                || $request->getRequestFormat() !== 'html'
                || stripos($response->headers->get('Content-Disposition'), 'attachment;') !== false
            ) {
                return;
            }
            //
        }
    
    opened by LocalHeroPro 0
  • Laravel Octane support

    Laravel Octane support

    Tried to register it in the flush section, still shows first request all the time.

    'flush' => [
        Fruitcake\TelescopeToolbar\ToolbarServiceProvider::class,
    ],
    
    opened by osbre 1
  • BindingResolutionException after installation

    BindingResolutionException after installation

    Hello,

    i've made a fresh new installation of laravel 8 + jetstream + telescope. then after adding your package, i've got this error after performing a "php artisan route:list" :

       Illuminate\Contracts\Container\BindingResolutionException
    
      Target [Laravel\Telescope\Contracts\EntriesRepository] is not instantiable while building [Fruitcake\TelescopeToolbar\Http\Controllers\ToolbarController].
    
      at S:\work\Kantazen\Project\Kantazen\bin\www\laravel-8-js\vendor\laravel\framework\src\Illuminate\Container\Container.php:1042
        1038▕         } else {
        1039▕             $message = "Target [$concrete] is not instantiable.";
        1040▕         }
        1041▕
      ➜ 1042▕         throw new BindingResolutionException($message);
        1043▕     }
        1044▕
        1045▕     /**
        1046▕      * Throw an exception for an unresolvable primitive.
    
      1   C:\Somewhere\Over\The\Rainbow\laravel-8\vendor\laravel\framework\src\Illuminate\Container\Container.php:839
          Illuminate\Container\Container::notInstantiable("Laravel\Telescope\Contracts\EntriesRepository")
    
      2   C:\Somewhere\Over\The\Rainbow\laravel-8\vendor\laravel\framework\src\Illuminate\Container\Container.php:712
          Illuminate\Container\Container::build("Laravel\Telescope\Contracts\EntriesRepository")
    
    opened by Ronan-Lenor 0
  • Toolbar doesn't work with browsersync

    Toolbar doesn't work with browsersync

    I would like to use laravel-telescope-toolbar with browserSync

    Toolbar works fine with php artisan serve on http://localhost:3000

    But after I enabled browserSync in webpack.mix.js:

    .browserSync({
        proxy: 'http://localhost:8000',
        files: [
            'resources/views/**/*.blade.php',
        ]
    });
    

    on domain http://localhost:8000 I don't see any toolbar and in Chrome console I see this error:

    Access to XMLHttpRequest at 'http://localhost:8000/_tt/render/92872b43-05f7-4ed3-807c-39f62ba9a9f8' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

    btw. telescope works on both domains http://localhost:8000/telescope http://localhost:3000/telescope

    I am not sure if it a bug or can you help me how can I fix it? Thanks

    opened by lichtner 1
  • [FR] Laravel Query Detector Integration?

    [FR] Laravel Query Detector Integration?

    I've been using Laravel Query Detector alongside the great barryvdh/laravel-debugbar package:

    https://github.com/beyondcode/laravel-query-detector

    I also use Telescope and thought likely better to Use Telescope and Telescope Toolbar ongoing but really miss this integration.

    Any thoughts on whether it could be integrated into your toolbar?

    Many Thanks!

    opened by ejntaylor 2
Releases(v1.3.2)
Owner
Fruitcake
Fruitcake
Rector upgrades rules for Symfony Framework

Rector Rules for Symfony See available Symfony rules Install This package is already part of rector/rector package, so it works out of the box. All yo

Rector 107 Dec 31, 2022
Symfony kafka bundle to produce and consume messages.

Technology stack Quick start Example project Basic Configuration Consuming messages Retrying failed messages Handling offsets Decoders Denormalizers V

STS Gaming Group 25 Oct 3, 2022
A generic content parser based on the devto markdown + frontmatter format, with liquid tag support

Parsed A generic content parser based on the devto post format, with front matter and liquid tag support. Parsed uses league/commonmark as base markdo

null 18 Dec 28, 2022
TypeResolver - A PSR-5 based resolver of Class names, Types and Structural Element Names

TypeResolver and FqsenResolver The specification on types in DocBlocks (PSR-5) describes various keywords and special constructs but also how to stati

phpDocumentor 9k Dec 29, 2022
A web tool to explore the ASTs generated by PHP-Parser.

phpast.com A web tool to explore the ASTs generated by PHP-Parser. About This web tool provides a GUI for exploring the AST of your PHP code. You can

Ryan Chandler 23 Nov 29, 2022
Rector upgrades rules for Laravel

Rector Rules for Laravel See available Laravel rules Install This package is already part of rector/rector package, so it works out of the box. All yo

Rector 185 Dec 30, 2022
Automagically generate UML diagrams of your Laravel code.

Laravel UML Diagram Generator Automagically generate UML diagrams of your Laravel code. Installation To install LTU via composer, run the command: com

Andy Abi Haidar 93 Jan 1, 2023
A fake mailer for Laravel Applications for testing mail.

MailThief MailThief is a fake mailer for Laravel applications (5.0+) that makes it easy to test mail without actually sending any emails. Note: Due to

Tighten 688 Nov 29, 2022
A rate limiter for Laravel

Laravel Throttle Laravel Throttle was created by, and is maintained by Graham Campbell, and is a rate limiter for Laravel. Feel free to check out the

Graham Campbell 673 Dec 30, 2022
A package to help you clean up your controllers in laravel

?? Laravel Terminator ?? ?? "Tell, don't ask principle" for your laravel controllers What this package is good for ? Short answer : This package helps

Iman 241 Oct 10, 2022
Render the symfony profiler toolbar in your terminal.

sourceability/console-toolbar-bundle Render the symfony profiler toolbar in your terminal. Each panel links to the corresponding web profiler page.

null 49 Nov 8, 2022
PHP Profiler & Developer Toolbar (built for Phalcon)

Prophiler - A PHP Profiler & Developer Toolbar built for Phalcon Demo The demo website has been moved to a separate repository: https://github.com/fab

Fabian Fuelling 444 Dec 27, 2022
A Laravel package to output a specific sql to your favourite debugging tool. The supported log output is Laravel Telescope, Laravel Log, Ray, Clockwork, Laravel Debugbar and your browser.

Laravel showsql A Laravel package to output a specific sql to your favourite debugging tool, your browser or your log file. Use case You often want to

Dieter Coopman 196 Dec 28, 2022
Easily add Laravel Telescope and Horizon to Filament admin panel.

Filament Debugger This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Installation You can inst

Stephen Jude 5 Nov 24, 2022
Developer Toolbar for Magento2

Developer Toolbar for Magento2 About Hope this debug toolbar can speed up Magento2 development module. Any feedback and idea to improve this toolbar w

Vincent Pietri 423 Dec 28, 2022
Magento Chrome Toolbar for MSP_DevTools

Magento Chrome Toolbar for MSP DevTools Magento Chrome Toolbar is a chrome extension to be used with MSP_DevTools for Magento 1 or Magento 2. This ext

MageSpecialist 308 Dec 10, 2022
Adds WordPress toolbar menu that allows users to switch theme for themselves.

Toolbar Theme Switcher — for WordPress Plugin provides toolbar (admin bar) menu to quickly switch between available themes. Theme choice is individual

Andrey Savchenko 20 Jul 23, 2021
Silex Web Profiler

The Silex Web Profiler service provider allows you to use the wonderful Symfony web debug toolbar and the Symfony profiler in your Silex 2.x application.

Silex 209 Dec 5, 2022
😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.

Tracy - PHP debugger Introduction Tracy library is a useful helper for everyday PHP programmers. It helps you to: quickly detect and correct errors lo

Nette Foundation 1.6k Dec 23, 2022
Low-overhead sampling profiler for PHP 7+

phpspy phpspy is a low-overhead sampling profiler for PHP. For now, it works with Linux 3.2+ x86_64 non-ZTS PHP 7.0+ with CLI, Apache, and FPM SAPIs.

Adam 1.3k Dec 24, 2022