Download the PHP package johannesschobel/laravel-revisionable without Composer

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

JohannesSchobel/Laravel-Revisionable

Easy and conventient way to handle revisions of your models within the database.

Requirements

Usage (Laravel 5 basic example - see Customization below as well)

1. Download the package or require in your composer.json:

2. Add the service provider to your app/config/app.php:

3. Publish the package config file:

this will create config/revisionable.php file, where you can adjust a few settings.

4. Run the migration in order to create the revisions table:

5. Add revisionable trait to the models you wish to keep track of:

And that's all to get you started!

Customization

The package offers a set of configuration options.

White-Listing Fields

If you would like to revision only specific fields of the model, you can define them like so:

This way, only the fields email and name are tracked and store as revision in the database. The default behaviour is to revision all fields.

Disable Revisions

If you want to disable revisions for a specific model just add the following variables to your model

Revision Cleanup

You can further specify that you only want to clean up old revisions of a model. By doing so, you can further define, how many revisions of one model you would like to keep in your database (default is set to 20). Say, if you add the 21st revision, the first one is deleted.

You may customize this behaviour for each model by changing the variables

Rollback (aka load old revisions)

Of course, you can rollback to an old revision of your model. The Trait added earlier (e.g., the Revisionable trait) already provides handy methods for you - so you don't need to worry about this.

You can either use the $model->rollbackToTimestamp($timestamp) or $model->rollbackSteps($steps) functions for this purpose. Note that there is a configuration flag revisionable.rollback.cleanup (default false) that indicates, whether the revisions rolled back should be deleted (true) or not (false).

Both functions return the rolled back model, which is already persisted in the database.

Demonstration


All versions of laravel-revisionable with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
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 johannesschobel/laravel-revisionable contains the following files

Loading the files please wait ....