Download the PHP package hoangphamdev/laravel-bitemporal without Composer

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

Laravel Bitemporal

Laravel package for working with bitemporal records in Eloquent models.

The package provides:

Requirements

Installation

If you are developing locally with a path repository, make sure the package is registered in your application's composer.json.

The package uses Laravel package discovery, so the service provider is loaded automatically.

Database Columns

Use the bitemporal() macro in your migrations:

This macro adds these columns:

Defaults created by the migration macro:

Column Purpose

Rollback helper:

Model Usage

Add the trait to any Eloquent model:

What the Trait Adds

Static Helpers

The trait also exposes:

Querying

Current Snapshot

By default, models using HasBitemporal are automatically scoped to the current snapshot.

You can also call the explicit scope:

The custom builder also exposes:

Query As Of a Specific Time

asOf() filters by valid time and still requires transaction_to to be the infinity datetime.

If a model is retrieved with asOf(), that valid time is stored on the instance and later used by bitemporalDelete() when no explicit valid time is provided.

Access Historical Rows

The custom builder exposes history() as a convenience clone of the current builder state, useful when you want to branch a query without mutating the original builder.

Disable Bitemporal Filtering

To query all rows without the automatic current-snapshot scope:

Or directly:

Find Helpers

The custom builder keeps find-style methods bitemporal-aware:

touch() is also wrapped to run on the matched models inside a transaction.

Versioned Update

bitemporalUpdate() closes the current version and creates a new version with updated data.

You can pass an explicit valid time:

Behavior:

If the model does not exist or does not have a record_uuid, the method returns false.

Versioned Delete

bitemporalDelete($validAt = null) versions the record instead of physically removing it.

You can also pass a valid time:

Behavior:

If the model was loaded with asOf(), the stored valid time is used automatically when you call bitemporalDelete() without arguments.

If the model does not exist, bitemporalDelete() returns false.

Physical Delete

If you want to physically remove rows without bitemporal versioning, use normal Eloquent delete methods:

Bulk deletes also remain physical deletes:

These bypass the versioning logic entirely.

Infinity Datetime Constant

Use the shared constant when you need the package-wide infinity value:

Example Model

Testing

Run the package test suite:

License

MIT


All versions of laravel-bitemporal with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/database Version ^9.0
illuminate/support Version ^9.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 hoangphamdev/laravel-bitemporal contains the following files

Loading the files please wait ...