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
Laravel catch Server-to-server requests #629
Comments
Background:Some additional info on this from my side: I first read your article on dev.to @joelharkes while researching this exact feature. Later, I found this open issue and noticed that you are the author of both the article and this issue. 😅 Code modifications:Next I implemented your suggested code and modified it a bit in order to show the HTTP requests in the timeline. I stripped the header & body info from my code as I didn't need them for my specific use case. Further I changed the event registration to be inside the global You can find my modified implementation in this gist: Clockwork modifications:Apart from that I also modified Clockworks' code by adding one extra line here: clockwork/Clockwork/Request/Timeline/Event.php Lines 94 to 98 in 954d18e
To turn it into this: public function toArray()
{
return [
'name' => $this->name,
'description' => $this->description,
'start' => $this->start, With this change I am able to achieve a behavior similar to how SQL queries are displayed: Additional thoughts:I'd love to see a default framework integration! Maybe a new "HTTP" tab could be introduced, just like the "Log" and "Database" tab. A new color + icon combination in the timeline for the requests would also be a nice addition. I am very much looking forward to seeing this feature getting integrated into clockwork directly! |
Hey, thanks for the suggestion. I will leave this for the next major release, since I want to do a more complete integration, with a new tab for the HTTP requests as suggested above. |
Laravel introduced events to catch server-to-server calls made in the framework: https://laravel.com/docs/10.x/http-client#events
These can be used to catch server-to-server calls and show them in the logging or in a separate tab:
for example i did some simple HTTP request logging:
Can this be added to the default framework integration?
The text was updated successfully, but these errors were encountered: