Download the PHP package stfn/laravel-pending-updates without Composer

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

Postpone model updates or temporarily keep them updated for some time

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status

When updating an Eloquent model, by using this package, you can postpone updating process for some time.

The model itself will not be updated in this case. The package will just schedule an update for you. So this news will be active only on 1st January for the whole day and after that, the package will revert the news to its previous state.

Installation

You can install the package via composer:

You can publish and run the migrations with:

You can publish the config file with:

This is the contents of the published config file:

When running the console command pending-updates:check all pending updates will be checked and if there is a need to revert some update to original table, this command will do that for you.

That command needs to be scheduled in the Laravel console kernel.

Usage

You should add the HasPendingUpdates trait to all models which need to have a pending update option.

With this in place, you will be able to postpone update of this model.

Using keep for

By using keep for, update will be performed at the moment, but package will revert changes after specific number of minutes, hours or days.

Using delay for

By using delay for, update will be performed later, after specific number of minutes, hours or days.

Using timestamps

You can also use timestamps to specify exact time when you want to update some model.

Using combination

A combination of specific minutes, hours, or days with timestamps is also possible.

Using methods on the model

By default, all fillable attributes are allowed to be postponed, but you can change that by overriding allowedPendingAttributes method.

Keep in mind that those fields also need to be fillable.

Sometimes scheduled update may fail, for various reasons. By default, the package will send that exception to your configured external report service like Sentry, Flare, or Bugsnag and after that, the record from the pending_updates table will be removed. If you want to change this behavior, you can override the updateCannotBeApplied method on the PendingUpdateModel.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-pending-updates with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
spatie/laravel-package-tools Version ^1.14.0
illuminate/contracts Version ^9.0|^10.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 stfn/laravel-pending-updates contains the following files

Loading the files please wait ....