Download the PHP package edujugon/tablediff without Composer

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

TableDiff

Comparing DB tables data for Laravel.

Installation

type in console:

Register TableDiff service by adding it to the providers array.

Let's add the Alias facade, add it to the aliases array.

Usage samples

Instance the main TableDiff class:

Add tables to be compared

Set the pivots

If the columns have the same name you could do it like follows:

Now, we can run the comparison and get the report

Of course, all those methods can be chained

Notice if you don't use column method, it will look for all columns with same name in both tables.

Merging

The simplest way yo do a merge is like follows

The above code snippet will update the column_to_update column values from base_table with the column_to_update column values of merge_table in matched ids.

Notice that merge method will update the matched records and also add those records that are new for base table.

Just merging matched records

Now, let's insert the new records.

merge, mergeMatched and mergeUnMatched methods accept callbacks before doing the merge and just after each update.

Before callback is perfect for casting data like. It takes the data which will be added.

The first callback is call each time the db is updated. It takes the collection to be updated and the data with the new values

In case of mergeUnMatched, the first callback takes the new elements to be added and is called for each chunk (By default 10)

Event

Once the merge is done the package fires an event call Edujugon\TableDiff\Events\MergeDone with some useful parameters

Parameters:

Extra payload can be anything you want to add the the event

Kepp in mind that eventPayload method have to be called before calling merge method.

That is perfect when need to do some actions after merging like store it in db, send notification, etc..


All versions of tablediff with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^5.1
illuminate/database Version ^5.1
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 edujugon/tablediff contains the following files

Loading the files please wait ....