Download the PHP package schoolpalm/queued-jobs without Composer

On this page you can find all versions of the php package schoolpalm/queued-jobs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package queued-jobs

SchoolPalm Queued Jobs

Latest Version on Packagist Total Downloads Tests

A Laravel queue infrastructure package that preserves application execution context (tenant, school, user, module) when dispatching and processing queued jobs. Designed for multi-tenant and multi-school Laravel applications.

Why?

In multi-tenant or multi-school applications, queued jobs often need access to the same context (tenant, school, user, module) that was present when the job was originally dispatched. Without context propagation, each job would need to manually resolve this information, leading to duplicated code and potential inconsistencies.

This package provides a clean, extensible way to automatically capture and restore the application execution context when dispatching and processing queued jobs.

Installation

Publish Configuration

Run Migrations

Quick Start

1. Create a Context-Aware Job

Extend ContextAwareJob:

2. Register a Context Resolver

In your AppServiceProvider:

3. Register a Context Restorer

The restorer runs before each queued job executes, restoring the application state:

4. Dispatch Jobs

Using the Facade (with fluent context overrides)

Standard Laravel Dispatch

If the job is dispatched via GenerateReport::dispatch(), the context will NOT be attached automatically. Always use the QueuedJobs::job() facade to ensure context propagation.

Fluent API Reference

QueuedJobs::job(object $job): JobBuilder

Start building a job dispatch.

Method Description
->withTenant(string\|int $id) Attach tenant context
->withSchool(string\|int $id) Attach school context
->withUser(string\|int $id) Attach user context
->withModule(string $module) Attach module context
->withMetadata(array $data) Attach arbitrary metadata
->withContext(array\|QueueContext $ctx) Attach full context object or array
->onConnection(?string $conn) Set queue connection
->onQueue(?string $queue) Set queue name
->delay($delay) Set job delay
->tries(int $tries) Override max retry attempts
->timeout(int $seconds) Override job timeout
->backoff(int\|array $backoff) Override retry backoff
->afterCommit(bool $value = true) Dispatch after DB commit
->middleware(array $middleware) Add job-specific middleware
->sync() Dispatch synchronously (immediate)
->dispatch() Execute the dispatch
->dispatchSync() Execute synchronously (immediate)
->result() Get the created QueueJobResult (or null)
->resultResource() Get a JobResultResource for the result (or null)
->resultArray() Get the result as an API-friendly array (or null)

QueuedJobs::resolveContextUsing(Closure $callback)

Register a callback that captures the current application context.

QueuedJobs::restoreContextUsing(Closure $callback)

Register a callback that restores application context before job execution.

QueuedJobs::context(array|QueueContext $context)

Set global or default context.

Job Result Tracking

The package includes optional job result tracking with a database-backed results table.

Creating a Result

For jobs extending ContextAwareJob, a result record is created automatically when the job is dispatched through QueuedJobs::job(...)->dispatch(). The created record uses the resolved queue context (school, user, module) and is exposed through the builder:

You can also create result records manually with JobResultManager:

Marking Completion / Failure

Querying Results

Context Serialization

Context is serialized with the job into the Laravel queue payload. The QueueContext value object is immutable and safely serializes/unserializes via PHP's native serialization. When the queue worker pops the job:

  1. Laravel unserializes the job (including the queueContext array)
  2. The RestoreJobContext middleware fires
  3. The array context is converted back to a QueueContext value object
  4. Your registered restoreContextUsing callback is invoked
  5. Your job's handle() method runs with full context restored

Architecture

Configuration

Option Default Description
connection QUEUE_CONNECTION env Default queue connection
queue QUEUE_NAME env Default queue name
capture_context true Auto-capture context on dispatch
auto_restore_context true Auto-restore context on job execution
middleware [RestoreJobContext::class] Middleware applied to jobs
tries 3 Default job retry count
timeout 120 Default job timeout (seconds)

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.


All versions of queued-jobs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^12.0|^11.0
illuminate/support Version ^12.0
illuminate/queue Version ^12.0
illuminate/cache Version ^12.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package schoolpalm/queued-jobs contains the following files

Loading the files please wait ...