New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No output in devtools extension when using dump()
#631
Comments
Hey, thanks for the detailed report. Unfortunately I think this is a sort-of limitation of how dump works. Looks like dump immediately sends the output to the browser, this means headers are also sent at the point when you call dump. Clockwork headers are set at the end of the request processing, but since at that point headers were already sent, this has no effect. The web UI still works, since it does not use the Clockwork headers at all and instead polls the Clockwork api for new requests. |
Hello and thanks for your reply. Would it technically be possible to set the necessary clockwork headers at the start of each request, so a |
Yeah, it is technically possible, there is no nice Laravel way to set the headers at the right time, but you could just use the underlying header('X-Clockwork-Id: ' . $this->app['clockwork']->request()->id);
header('X-Clockwork-Version: ' . \Clockwork\Clockwork::VERSION); I don't think this is something we want to do in Clockwork though. |
Description
Whenever I use a
dump()
statement in my PHP code, nothing is logged in the embedded clockwork console in my browser devtools panel. The web-interface in myapp.localhost/clockwork works perfectly fine though.Using the network tab of my browser's devtools, I can see that the X-Clockwork headers and response cookies are missing whenever I am using a
dump()
call.Example code
routes/web.php:
app/Http/Controllers/TestController.php:
Expected Result
Dumping data with
dump()
should not interfere with the logging behavior of the browser extension. The necessary data does get generated and saved, as it is available in the standalone web-interface.I understand if it doesn't work with Laravel's
dd()
function, as this function callexit(1)
and thus ends the PHP process directly.Is there something I need to configure in Laravel or Clockwork to get this working?
Actual Result
Browser:
Browser Extension (DevTools Panel):
Web-Interface:
The text was updated successfully, but these errors were encountered: