Official Laravel source
AttributeIlluminate\Queue\Attributes\DeleteWhenMissingModels

#[DeleteWhenMissingModels]

Mark the job for deletion if the models do not exist.

Available since

Laravel 13.0

Targets

class

Parameters

Nenhum parâmetro obrigatório ou opcional.

Practical usage

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\Attributes\DeleteWhenMissingModels;

#[DeleteWhenMissingModels]
class ProcessInvoice implements ShouldQueue
{
    public function handle(): void
    {
        //...
    }
}