Download the PHP package highsolutions/eloquent-sequence without Composer

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

Eloquent Sequence

License: MIT

Easy creation and management sequence support for Eloquent models with elastic configuration.

Eloquent-Sequence by HighSolutions

Installation

This package can be installed through Composer:

Or by adding the following line to the require section of your Laravel webapp's composer.json file:

Run composer update to install the package.

Version Compatibility

Laravel Eloquent-Sequence
5.1.x 2.1.x
5.2.x 2.2.x
5.3.x 2.3.x
5.4.x 2.4.x
5.5.x 2.5.x
5.6.x 2.6.x
5.x.x 3.3.x
6.x.x 3.4.x
7.x.x 3.7.x
8.x.x 3.8.x
9.x.x 3.9.x
10.x.x 3.10.x
11.x.x 3.11.x

Updating Eloquent models

Note: as a field name do not use name of any exisiting method in that class, including sequence, as this will not work.

Configuration

You can specify four parameters:

Usage

Set sequence attribute

Sequence attribute will be set during model creation.

After this metod field values of $section will be looking as:

When we create another Section objects:

We get list of objects with fields:

Delete object and update sequence

But when we delete object:

Sequence values will be updated accordingly:

Get objects with proper sequence

To get object just add ->orderBy('seq', 'asc') method:

or with local scope sequenced:

Move object one position higher

To move object one position higher (swap position with earlier object) you only need to:

This will set sequence attribute to one position lower and object one position lower will have sequence attribute changed to one position further.

Narrowing groups from configuration will be of course used.

Move object one position lower

The same you can do it to make your object next in line:

This will set Section ID=2 with sequence attribute like next Section object (based on sequence attribute) and swap their values accordingly.

Move object to the first position

To move object to the first position, you only need to:

This will set sequence attribute to the first position in the sequence and will reorder the objects between the original position and the first position accordingly.

Narrowing groups from configuration will be of course used.

Move object to the last position

To move object to the last position, you only need to:

This will set sequence attribute to the last position in the sequence and will reorder the objects between the original position and the last position accordingly.

Narrowing groups from configuration will be of course used.

Move object to any position

You are able to move object to another position also. This is very useful when you are implementing drag&drop functionality.

This will set Section ID=2 with sequence attribute to 5th and rest objects' sequence attribute will be updated to match proper order.

Refresh positions in model

Sometimes you may need to recalculate all position for given model (e.g. because of manually manipulating dataset). You can do it easily via:

This static method will recalculate sequence attributes for every record for this model. Narrowing groups will be used as well as current sequence attribute of every record.

Check if object is first in the collection

You are able to check if object is first in its group.

This will return true or false regarding is this a first element in the collection.

Check if object is not first in the collection

You are able to check if object is not first in its group.

This will return true or false regarding is this not a first element in the collection.

Check if object is last in the collection

You are able to check if object is last in its group.

This will return true or false regarding is this a last element in the collection.

Check if object is not last in the collection

You are able to check if object is not last in its group.

This will return true or false regarding is this not a last element in the collection.

Testing

Run the tests with:

Changelog

3.11.0

3.9.0

3.8.0

3.7.0

3.6.0

3.5.0

3.4.0

3.3.0

3.2.0

3.1.0

3.0.2

3.0.0

2.6.2

2.6.0

2.5.0

2.4.0

2.3.0

2.2.0

2.1.0

2.0.3

2.0.2

2.0.1

2.0.0

1.3.1

1.3.0

1.2.0

1.1.1

1.1.0

1.0.0

0.9.0

Credits

This package is developed by HighSolutions, software house from Poland in love in Laravel.


All versions of eloquent-sequence with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3|>=8.0.2
illuminate/support Version 5.*|^6.0|^7.0|^8.0|^9.0|^10.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 highsolutions/eloquent-sequence contains the following files

Loading the files please wait ....