// operations/XXXX_XX_XX_XXXXXX_awesome_operation.php
use TimoKoerber\LaravelOneTimeOperations\OneTimeOperation;
return new class extends OneTimeOperation
{
/**
* Determine if the operation is being processed asynchronously.
*/
protected bool $async = true;
/**
* The queue that the job will be dispatched to.
*/
protected string $queue = 'default';
/**
* A tag name, that this operation can be filtered by.
*/
protected ?string $tag = null;
/**
* Process the operation.
*/
public function process(): void
{
//
}
};
// operations/XXXX_XX_XX_XXXXXX_awesome_operation.php
public function process(): void
{
User::where('active', 1)->update(['status' => 'awesome']) // make active users awesome
}