Runner

Beta

Laravel’s missingbackground job.

Sometimes you just want to run a task without blocking your request.

A project from
Obelaw
composer require obelaw/laravel-runner

MIT Licensed · Free forever · Obelaw Packages

1
Install

Require the composer package in your Laravel project.

 composer require obelaw/laravel-runner 
2
Define a job

Create a job class implementing the ShouldQueue contract.

 use Obelaw\Runner\Contracts\ShouldQueue;

class ProcessPodcast implements ShouldQueue
{
    public function handle(): void
    {
        
    }
}
3
Dispatch & schedule

Dispatch a one-off job, or schedule a recurring task.

 Runner::dispatch(new ProcessPodcast($podcast));

Runner::schedule(function () {
    
})->daily();
4
Run the worker

Boot a worker to start consuming jobs. Retries, timeouts, and failure handling are built in.

 php artisan runner:work 
Awesome contributors