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');

source