We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Dispatching closure jobs after response can be a really nice way to do some cleanup 💅:
$pdf->store('file.pdf');
// Delete the file after the response has been sent
dispatch(fn () => Storage::delete('file.pdf'))->afterResponse();
return Zip::download('file.pdf');
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.