1. Go to this page and download the library: Download kpconnell/laravel-jobwarden library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kpconnell / laravel-jobwarden example snippets
config('jobwarden.connection')
use JobWarden\Contracts\JobWardenJob;
use JobWarden\Dispatch\Dispatchable;
use JobWarden\Runner\JobContext;
final class ImportCatalog implements JobWardenJob
{
use Dispatchable;
public function __construct(
private readonly string $storeId,
private readonly bool $fullSync = false,
) {
}
public function handle(JobContext $context, ?CatalogClient $client = null): void
{
// $client is container-injected per run.
// Constructors are data-only.
//
// Do the work here.
// Returning means success.
// Throwing means failure.
}
public function idempotent(): bool
{
return true;
}
}