In this episode, we're making our job a bit more efficient by updating how often it runs, just to speed up our feedback loop—no more waiting ages for checks! We bump the frequency to every 10 seconds so we can see updates in near real time.
Then, we dive into using Laravel's HTTP client and our established model relationships to start saving the response data from each check to our new checks
table. That means for every check, we're capturing things like the response code and, if the check fails, the response body too. We only save the response body when necessary—otherwise, it's set to null.
Once everything is wired up, we hop into the console to run our short schedule and watch as new entries appear in the database every 10 seconds. To test it all out, we even deliberately break an endpoint to see how 404 responses get logged. Sure enough, the failed check shows up with the correct status code and body data, which is exactly what we want!
This episode is all about tightening up our feedback loop and making sure our job is storing meaningful data as it runs.