Download the PHP package guifcoelho/immu-table without Composer

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

Build Status

ImmuTable

Package for using immutable ndjson models instead of regular SQL or NoSQL databases with sintax similar to Laravel Eloquent.

DO NOT use this package if your data are likely to change.

Installation

composer require guifcoelho/immu-table

How to use it

Configuration

The config class will look for a config_path() function. This function must return the configuration files repository where the immutable.php configuration file is located.

Copy immutable.php configuration file from src/Config and paste it into your own configuration folder.

By default, the tables will be stored in storage/app/immutable/tables.

The Engine class will load the tables in chunks of data. You can increase or decrese the chunk_size in the configuration file.

Declaring your model

Create models the same way as in Laravel Eloquent:

It will load your data from the table table_example.ndjson and set all fields accordingly. If you want to restrict the fields to be loaded, just include the protected array $fields:

If you do not want some fields to be returned in the toArray() or toJson() functions, just include their names in the $hidden array:

If you want your primary key to be anything but 'id', just declare it as below (remember that your primary key must be unique and integer):

Querying your models

You can query your model for data the same way as in Laravel Eloquent:

or,

or chaining 'where' clauses,

or chaining 'orWhere' clauses

Declaring relations

You can declare relations between models the same way as Laravel Eloquent. Please, look into the Model class to see which relations are implemented.

In the example above, the fields inside brackets are optional. See below a better explanation:

Contributing and testing


All versions of immu-table with dependencies

PHP Build Version
Package Version
Requires php Version ~7.3
illuminate/config Version ^5.8
symfony/finder Version ^4.3
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 guifcoelho/immu-table contains the following files

Loading the files please wait ....