Download the PHP package phpinnacle/sequentia without Composer

On this page you can find all versions of the php package phpinnacle/sequentia. 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 sequentia

Sequentia for Laravel

Sequentia generates scoped, bucketed and date-aware sequence numbers for Laravel models. Counter updates use an atomic database upsert and can be isolated by tenant, model scope, bucket and time period.

Installation

For manual installation:

Registering counters

Register watched Eloquent models from an application service provider:

Every created model increments all-time, yearly and monthly counters. Bucketed counters are isolated by the configured scheme; global counters ignore it and count each record once per tenant and model scope, even when multiple schemes are registered. Pass a model attribute name as tenant to isolate counters by tenant. Repeated registration of the same scheme replaces its definition without adding another listener. Registrations belong to the current Eloquent event dispatcher; register them again when booting a new application or replacing that dispatcher.

Formatting numbers

Available counters are SA, SY, SM, GA, GY and GM: scoped/global counters for all time, year and month. Date placeholders are D, DD, M, MM, Y, YY and W. Additional context may be passed to get().

Sequence::get() reads the stored values plus one. It does not reserve a number; concurrent callers may read the same prospective value.

Rebuilding counters

Rebuild registered counters from existing records when necessary:

Before rebuilding, pause writes to watched models and direct SequenceWatcher::store() calls, drain active requests and queue jobs, and prevent another rebuild from starting. Keep writes paused until the command finishes. Rebuild does not acquire locks on source models and does not support concurrent writes, including when counters use a separate connection. Normal creation events still use atomic increments.

Rebuild aggregates records returned by each registered model's query, including its global scopes, then replaces the resulting counter keys in one transaction. Repeating it over unchanged data gives the same values. It preserves keys absent from that result, including other scopes, tenants, buckets and periods; it does not clear counters for deleted records or removed schemes when their keys are no longer represented. Historical hashes do not identify which scheme owns a missing bucket, so the command cannot safely infer those deletions. Aggregate memory use grows with the number of distinct counter keys.

Rebuilding reads the model's CREATED_AT attribute as a DateTimeInterface. Standard Eloquent timestamps provide this automatically, including renamed timestamp columns. If automatic timestamps are disabled, declare a date cast for that attribute. Models without a creation date should set CREATED_AT to null; rebuilding uses the current period for those records.

Configuration

Set connection in phpinnacle-sequentia.php to store counters on a dedicated database connection. The current atomic upsert implementation requires PostgreSQL.

Testing

From the monorepo root, run vendor/bin/pest packages/sequentia/tests for SQLite coverage. To run the same suite plus concurrent increment verification on PostgreSQL, use a dedicated empty test database:

The suite creates and drops sequences and sequence_records. In a standalone package checkout, use vendor/bin/pest tests instead.

License

The MIT License (MIT). See License File.


All versions of sequentia with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/console Version ^13.0
illuminate/database Version ^13.0
illuminate/support Version ^13.0
spatie/laravel-package-tools Version ^1.92
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 phpinnacle/sequentia contains the following files

Loading the files please wait ...