Laravel Artisan Queue Command: The queue:forget Command


John Koster

Published on December 7, 2016

The queue:forget command is used to remove a single failed queue job entry from the failed_jobs database table. The command accepts the id of the job to remove as its only argument. The following example demonstrates the usage of the queue:forget command:

1# Remove a single job from the failed jobs table.
2php artisan queue:forget 1

If the command was successful in removing the job it will output Failed job deleted successfully!; No failed job matches the given ID. will be displayed on failure.

It accomplishes this by calling the forget method on the configured Illuminate\Queue\Failed\FailedJobProviderInterface instance (this interface is bound to the key queue.failed in the service container; this returns an instance of Illuminate\Queue\Failed\DatabaseFailedJobProvider by default). The following PHP method call is equivalent:

1// Remove a single job from the failed jobs table.