Download the PHP package motomedialab/compliance without Composer

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

MotoMediaLab Compliance

MotoMediaLab compliance is a highly configurable package that helps you to stay on the right side of modern data regulations by automatically deleting records that are no longer necessary to be stored. For example, a user that hasn't logged in to your system in three years.

How does it work?

This package provides an interface and a trait that can be applied to any model. These have a series of methods that you can modify in order to change the desired functionality on a per-model basis.

By default, the package will look for a last_login_at column on the model and queue the record for deletion if it's older than the configured number of days (defaults to 365 * 3 / 3 years). The last_login_at is of course geared towards a User model, but the query is completely customisable per model.

Scheduled tasks

Two commands are automatically scheduled, one for checks and one for pruning.

The check command compliance:check

On a daily basis, the check job runs through all of your defined models and searches for records that meet the deletion criteria. If the criteria is met, it'll create a ComplianceCheck model. This will also emit a ComplianceRecordPendingDeletion event. This ComplianceCheck model also stores the date on which the record should be deleted.

The prune command compliance:prune

On a daily basis, the prune job runs through all of the ComplianceCheck records that have exceeded the deletion_date date. Much like the check job, it'll then once again check for compliance. If the deletion criteria is still met, it'll delete the model and the associated check record. Before deletion, the ComplianceDeleting event will be emitted.

Events

The package emits two events, ComplianceRecordPendingDeletion which is emitted when a model is marked for deletion and ComplianceDeleting which is emitted just before the model is deleted.

These events allow you to easily take action or notify the customer that their account will be closed without their action.

Installation

You can install the package via composer:

After installing the package, you'll need to publish the configuration file. From here, you can specify the models that should be checked for compliance. You'll also need to run the migrations.

Example

Example model:

The above implementation will use the default configuration. It'll search for all users that have a last_login_at column that is older than 3 years.

Configuration

The configuration file is located at config/compliance.php. Here you can specify the models that should be checked for compliance. You can also specify the number of days that a record should be kept before deletion and the grace period between 'checking' and deletion.

Advanced configuration

There are a number of methods that you can override in the ComplianceRules trait. These methods allow you to customise the query that is run, the checks that are performed, and most importantly, an additional check to see if a record should be deleted.


All versions of compliance with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^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 motomedialab/compliance contains the following files

Loading the files please wait ....