lorisleiva / laravel-actions

⚡️ Laravel components that take care of one specific task
https://laravelactions.com
MIT License
2.52k stars 124 forks source link

Manual failing or release job #158

Closed robert-abram closed 2 years ago

robert-abram commented 2 years ago

Helo, How to manual fail or release job. Using laravel job, we can use in handle method

$this->fail(); or $this->release();

https://laravel.com/docs/8.x/queues#manually-releasing-a-job

travisaustin commented 2 years ago

Try this:

class ExampleJobThatAlwaysFails
{

    use AsAction;

    public function asJob(JobDecorator $job)
    {
        $job->fail(); // or $job->release();
    }
}