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

Compliance: Your Automated Data Retention Guardian

In today's world of data privacy regulations like GDPR, you can't hold onto user data forever. But manually tracking and deleting old records is a headache waiting to happen. Compliance is a configurable Laravel package that automates this process, ensuring you stay on the right side of the law by effortlessly deleting records that are no longer needed.

Think of it as a fire-and-forget solution for data retention. Set up your rules, and let Compliance handle the rest.

How It Works: The Two-Step Deletion Process

Compliance operates on a safe, two-step cycle to ensure records are never deleted by mistake. This gives you a grace period to act, for instance, by notifying a user that their account is about to be removed.

  1. The Check (artisan compliance:check):

    • Every day, a scheduled command runs through your specified models (like User).
    • It looks for records that meet your defined deletion criteria (e.g., users who haven't logged in for 3 years).
    • When a record matches, Compliance creates a ComplianceCheck entry in your database, marking the record with a future deletion date.
    • At this point, the ComplianceRecordPendingDeletion event is fired. This is your chance to hook in and, for example, send a notification email.
  2. The Prune (artisan compliance:prune):
    • A second daily command scans for ComplianceCheck records where the deletion date has passed.
    • It performs a final check on the model to ensure it still meets the deletion criteria. This is a safety net... If a user logs in after being marked for deletion, their account will be spared.
    • If the criteria are still met, the ComplianceDeleting event is fired just before the model is permanently deleted.

Installation

Getting started is easy, just follow these three steps...

  1. Install via Composer:

  2. Publish Configuration & Run Migrations: Publish the configuration file to specify which models to monitor. Then, run the migrations to create the compliance_checks table.

Quick Start: The Basic User Model

Out of the box, the package is configured to handle a typical User model. Just implement the HasCompliance contract and use the ComplianceRules trait.

Next, add your User model to the config/compliance.php file.

And that's it! The package will now automatically schedule users for deletion if their last_login_at date is over three years old.

Advanced Scenarios & Powerful Examples

The real power of this package lies in its flexibility. You can override several methods from the ComplianceRules trait to build highly custom logic.

Example 1: Deleting Only Users Who Have Never Logged In

You might want to clean up accounts that were created but never used. You can override the complianceQueryBuilder method to define a completely custom query.

Example 2: Protecting VIPs or Active Subscribers

You never want to accidentally delete a paying customer. The complianceMeetsDeletionCriteria method is your safety check, which runs both during the initial check and right before the final deletion.

Example 3: Notifying Users of Pending Deletion

Compliance fires events to let you hook into the lifecycle. Here’s how you can listen for the ComplianceRecordPendingDeletion event to email a user.

First, create a listener: php artisan make:listener NotifyUserOfPendingDeletion

Then, register it in your EventServiceProvider:

Finally, implement the listener's logic:

Example 4: Cleaning Up Old Log Entries

This package isn't just for users. You can apply it to any model. Imagine you have a Log model and you only want to keep records for 90 days.

Then, simply apply the trait and interface to your Log model.


All versions of compliance with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^10.0|^11.0|^12.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 ....