Download the PHP package khalyomede/reorder-before-after without Composer

On this page you can find all versions of the php package khalyomede/reorder-before-after. 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 reorder-before-after

reorder-before-after

Reorder an item in an array before or after another.

Summary

About

I make a web app in which my users can reorder before or after another.

I did not find any package to do what I search for, and since I use it at multiple place on my app I figured I would open source it in the hope it can help simplify the life of another developer out there!

Features

Requirements

Installation

In your terminal, on the root of your project folder, run:

Examples

1. Moving an item before another

In this example, we will move our book before our table.

2. Create a list of items out of any type

In this example, we will see that we can create a listing of anything, including objects.

3. Find an item by its value

In this example, we will see we can find an item by its "value" (the first parameter when creating a new instance of Item).

If the method finds no item matching the value, a ItemNotFoundException will be thrown.

You can also search by anything that can be checked using ===, including objects.

4. Create a listing from an array

In this example, we will create the listing from an array instead of manually pushing items.

5. Getting all items from a listing

In this example, we will get all items from a listing. Useful if you want to perform some task after reordering your items.

6. Use a callback to apply the order on your value

In this example, we will instruct the listing how it should set the order on our values. Useful if our values are objects holding their order. This saves you from looping again on all your objects.

This examples features an hypothetical Product Eloquent model.

7. Create a listing from values and specify how to retrieve the order using a callback

In this example, we will see how to create a listing out of an array of values, and using the second parameter to specify how to get the order from these values.

Useful if you have objects that already hold their own order, and you do not want to loop from them and create the Item by hand.

8. Specify how to match items together

In this example, we will instruct the listing how it should match our objects. Useful if your objects can contain different set of data, making the whole object different, when in reality both are equal (matching by id).

This examples features an hypothetical Product Eloquent model, where one of the two can have more attributes (like eager loaded relationships), making the triple equal check invalid.

Tests

Or


All versions of reorder-before-after with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1.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 khalyomede/reorder-before-after contains the following files

Loading the files please wait ....