Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Delay Jobs if Some Condition Fails

Premium
4:21

Comments & Discussion

DK
danish khan ✓ Link copied!

🧵 Question: How to Cancel a Delayed Job in Laravel?

Let’s say I allow users to schedule a job (like downloading their account data) that runs after N minutes/hours.

The job is queued with a delay (using delay() or Queue::later()), and stored in Redis or Database, depending on the config.

Now, if the user changes their mind and clicks "Cancel", I want to remove that scheduled job before it runs.

I know queue:forget is for failed jobs, but:

❓ What’s the recommended / optimized way in Laravel to cancel a scheduled (delayed) job before it's executed?

Any clean way to remove it using Laravel’s built-in features? Or do I need to manually remove it from Redis/database?

Thanks!

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.