fruitcake / laravel-telescope-toolbar Goto Github PK
View Code? Open in Web Editor NEWA toolbar for Laravel Telescope, based on the Symfony Web Profiler.
License: MIT License
A toolbar for Laravel Telescope, based on the Symfony Web Profiler.
License: MIT License
This package causes error in postman whenever a route returns an HTTP 204 response code. Since 204 response should have no body content, this package return HTML body, hence the HTTP error in postman
You can test this with the '/sanctum/csrf-cookie' route
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!
Injects toolbar even if request has any of the headers:
Content-Type: application/json
Accept: application/json
Via postman you have to add this header:
X-Requested-With: XMLHttpRequest
But sometimes it doesn't exist even if request is async. :-)
The current lay-out is exactly the same as the Symfony Webprofiler Toolbar, except for (some of) the icons.
If somebody is interested in creating a (simple) Laravel colour scheme/tweaks to the Toolbar, let me know :)
On a new Laravel 11 installation. Installation of laravel telescope installed version 5. But when I ran 'composer require fruitcake/laravel-telescope-toolbar --dev' it failed with the following messages.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- fruitcake/laravel-telescope-toolbar[v1.0.0, ..., v1.2.5] require php ^7.1.3 -> your php version (8.2.16) does not satisfy that requirement.
- fruitcake/laravel-telescope-toolbar v1.3.0 requires php ^7.3 -> your php version (8.2.16) does not satisfy that requirement.
- fruitcake/laravel-telescope-toolbar v1.3.1 requires laravel/framework ^8 -> found laravel/framework[v8.0.0, ..., v8.83.27] but it conflicts with your root composer.json require (^11.0).
- fruitcake/laravel-telescope-toolbar v1.3.2 requires laravel/framework ^8|^9 -> found laravel/framework[v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16] but it conflicts with your root composer.json require (^11.0).
- fruitcake/laravel-telescope-toolbar v1.3.3 requires laravel/framework ^9|^10 -> found laravel/framework[v9.0.0, ..., v9.52.16, v10.0.0, ..., v10.48.2] but it conflicts with your root composer.json require (^11.0).
- fruitcake/laravel-telescope-toolbar v1.3.4 requires laravel/telescope ^4 -> found laravel/telescope[v4.0.0, ..., v4.17.6] but it conflicts with your root composer.json require (^5.0).
- Root composer.json requires fruitcake/laravel-telescope-toolbar * -> satisfiable by fruitcake/laravel-telescope-toolbar[v1.0.0, ..., v1.3.4].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require fruitcake/laravel-telescope-toolbar:*" to figure out if any version is installable, or "composer require fruitcake/laravel-telescope-toolbar:^2.1" if you know which you need.
How can I solve this? Thank you.
I got some warnings causing by toolbar. Please advise how to handle it?
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
Package league/commonmark-ext-table is abandoned, you should avoid using it. Use league/commonmark instead.
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Package spatie/laravel-cors is abandoned, you should avoid using it. Use laravel/framework instead.
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
Some ideas:
Sfjs.loadToolbar(token)
instead of opening Telescope.Running this package (latest) locally I am getting this error on the toolbar.
An 500 error occurred while loading the Telescope Toolbar. Make sure you configured/installed Telescope correctly
When viewing the call to the backend this is the error:
{
"message": "htmlspecialchars() expects parameter 1 to be string, array given (View: /home/vagrant/project/vendor/fruitcake/laravel-telescope-toolbar/resources/views/collectors/queries.blade.php)",
"exception": "Facade\\Ignition\\Exceptions\\ViewException",
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Support/helpers.php",
"line": 262,
"trace": [
{
"function": "handleError",
"class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Support/helpers.php",
"line": 262,
"function": "htmlspecialchars"
},
{
"file": "/home/vagrant/project/vendor/fruitcake/laravel-telescope-toolbar/src/../resources/views/collectors/queries.blade.php",
"line": 56,
"function": "e"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php",
"line": 41,
"function": "include"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php",
"line": 57,
"function": "evaluatePath",
"class": "Illuminate\\View\\Engines\\PhpEngine",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/facade/ignition/src/Views/Engines/CompilerEngine.php",
"line": 37,
"function": "get",
"class": "Illuminate\\View\\Engines\\CompilerEngine",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/View.php",
"line": 139,
"function": "get",
"class": "Facade\\Ignition\\Views\\Engines\\CompilerEngine",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/View.php",
"line": 122,
"function": "getContents",
"class": "Illuminate\\View\\View",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/View.php",
"line": 91,
"function": "renderContents",
"class": "Illuminate\\View\\View",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/fruitcake/laravel-telescope-toolbar/src/../resources/views/toolbar.blade.php",
"line": 20,
"function": "render",
"class": "Illuminate\\View\\View",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php",
"line": 41,
"function": "include"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php",
"line": 57,
"function": "evaluatePath",
"class": "Illuminate\\View\\Engines\\PhpEngine",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/facade/ignition/src/Views/Engines/CompilerEngine.php",
"line": 37,
"function": "get",
"class": "Illuminate\\View\\Engines\\CompilerEngine",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/View.php",
"line": 139,
"function": "get",
"class": "Facade\\Ignition\\Views\\Engines\\CompilerEngine",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/View.php",
"line": 122,
"function": "getContents",
"class": "Illuminate\\View\\View",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/View.php",
"line": 91,
"function": "renderContents",
"class": "Illuminate\\View\\View",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Http/Response.php",
"line": 62,
"function": "render",
"class": "Illuminate\\View\\View",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Http/Response.php",
"line": 34,
"function": "setContent",
"class": "Illuminate\\Http\\Response",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 759,
"function": "__construct",
"class": "Illuminate\\Http\\Response",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 731,
"function": "toResponse",
"class": "Illuminate\\Routing\\Router",
"type": "::"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 685,
"function": "prepareResponse",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 128,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/fruitcake/laravel-telescope-toolbar/src/Http/Controllers/ToolbarController.php",
"line": 32,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 149,
"function": "Fruitcake\\TelescopeToolbar\\Http\\Controllers\\{closure}",
"class": "Fruitcake\\TelescopeToolbar\\Http\\Controllers\\ToolbarController",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/telescope/src/Http/Middleware/Authorize.php",
"line": 18,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Laravel\\Telescope\\Http\\Middleware\\Authorize",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
"line": 41,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php",
"line": 49,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
"line": 116,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
"line": 62,
"function": "handleStatefulRequest",
"class": "Illuminate\\Session\\Middleware\\StartSession",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Session\\Middleware\\StartSession",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php",
"line": 37,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php",
"line": 66,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Cookie\\Middleware\\EncryptCookies",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 103,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 687,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 662,
"function": "runRouteWithinStack",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 628,
"function": "runRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 617,
"function": "dispatchToRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 165,
"function": "dispatch",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 128,
"function": "Illuminate\\Foundation\\Http\\{closure}",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/home/vagrant/project/app/Http/Middleware/SchoolSubdomains.php",
"line": 25,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "App\\Http\\Middleware\\SchoolSubdomains",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/fideloper/proxy/src/TrustProxies.php",
"line": 57,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Fideloper\\Proxy\\TrustProxies",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
"line": 27,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php",
"line": 63,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 103,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 140,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 109,
"function": "sendRequestThroughRouter",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/home/vagrant/project/public/index.php",
"line": 55,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
}
]
}
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.
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.
When a Livewire component class has a mount method. Telescope toolbar stops working.
Pasting the error log here below:
htmlspecialchars() expects parameter 1 to be string, array given (View: /path-to-my-app/vendor/fruitcake/laravel-telescope-toolbar/resources/views/collectors/request.blade.php) (View: /pathtomyapp/vendor/fruitcake/laravel-telescope-toolbar/resources/views/collectors/request.blade.php) {"exception":"[object] (ErrorException(code: 0): htmlspecialchars() expects parameter 1 to be string, array given
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;
}
//
}
Can be added an environment variable to the theme in order to turn off the light without discovering package?
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)
#39 happens when you try to deploy to prod but you activate telescope only for dev.
Possible fix:
if (! class_exists(EntryType::class)) {
return [];
}
It would be nice to have option copy to clipboard for each SQL query in the list.
Hi, i didn't find the command to publish the config file in the project.
I use different middleware, so assets are not loaded on the tool bar.
Its planned to add the publish command ?
Julien
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")
Is it possible to only enable this when DEBUGBAR_ENABLED or a different variable is enabled. Instead of APP_DEBUG?
Laravel: 7.8.1
Telescope: ^3
Toolbar: 1.2.3
Reproduce:
// Some controller
public function store(Request $request)
{
$this->validate($request, [
'foo' => 'required'
]);
$data = new Counter;
$data->foo = $request->input('foo');
$data->save();
return redirect()->back();
}
This successfully runs, but the redirect is hijacked by the asset
/_tt/assets/styling.css
Even hijacks when running in app_env=production
but I believe that might be an issue with how I'm loading telescope, so possibly ignore that.
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.
Tried to register it in the flush
section, still shows first request all the time.
'flush' => [
Fruitcake\TelescopeToolbar\ToolbarServiceProvider::class,
],
Telescope ^3.0 released 20 hours ago (https://github.com/laravel/telescope/releases). It removed support for Laravel 5.8. Will the toolbar drop support for 5.8 aswell and move to a new major?
After a recent upgrade, the toolbar stops showing up and i get the following error in my console
I believe the error may be related to missing frontend assets but I can find no mention of frontend assets anywhere in the docs, so I have been unable to troubleshoot any further.
I upgraded from Laravel 8 to Laravel 10
The versions I have installed are:
"fruitcake/laravel-telescope-toolbar": "^1.3",
"laravel/telescope": "^5.0",
They are both installed in the dev section.
Telescope itself works fine. The only problem I have is with the toolbar itself.
Any pointers would be appreciated.
Cant figure it out with the new HTTPS configuration, see error from console below.
It wont load in Chrome (it does load in IE though ;) ).
VM106:1 Mixed Content: The page at 'https://DOMAIN.TLD/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://DOMAIN.TLD/_tt/render/9037011f-4885-4657-8a25-10b8ea29032c'. This request has been blocked; the content must be served over HTTPS.
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!
I've installed Telescope and set it up to only register and be used on the dev environment, no problems there.
The issue is when I install this Toolbar and publish the config, when running composer install
on a non-dev env, it throws a Facade error.
Digging into things, the cause is the config references Horizon classes Laravel\Telescope\EntryType
in the collectors
array in the toolbar config file that's published.
Any ideas on a way around this for a local only environment?
I am only loading Telescope and Toolbar packages on the local environment in AppServiceProvider.php@register
if ($this->app->isLocal()) {
// Laravel Telescope
$this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
$this->app->register(TelescopeServiceProvider::class);
// Laravel Telescope Toolbar
$this->app->register(\Fruitcake\TelescopeToolbar\ToolbarServiceProvider::class);
}
Error
[2020-06-25 17:32:02] production.ERROR: Class 'Laravel\Telescope\EntryType' not found {"exception":"[object] (Error(code: 0): Class 'Laravel\\Telescope\\EntryType' not found at /home/vagrant/project/config/telescope-toolbar.php:97)
[stacktrace]
#0 /home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(72): require()
#1 /home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(39): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration->loadConfigurationFiles()
#2 /home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(230): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration->bootstrap()
#3 /home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\\Foundation\\Application->bootstrapWith()
#4 /home/vagrant/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#5 /home/vagrant/project/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle()
#6 {main}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.