Download the PHP package r4nkt/laravel-resource-tidier without Composer

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

R4nkt's Laravel Resource Tidier

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

A simple-but-opinionated set of classes that allows for configurable tidying of various user resources. It allows you to configure "tidiers", which find resources that need to be tidied up, culling them, notifying resource owners, and eventually performing the tidying-up task. It also allows for "unmarking" resources if/when the circumstances demand it.

This package was developed to scratch an itch, but it was also inspired by Freek and his blog post about removing inactive users and teams.

It should also be noted that it's the foundation for another r4nkt package, which may be useful in your own projects or as an example on how to use laravel-resource-tidier.

Finally, it's important to point out that this package benefitted from Spatie's Laravel package skeleton package.

Installation

You can install the package via composer:

You can publish the config file with:

This is the contents of the published config file:

Usage

To get a registered tidier, you can simply use the tidier factory like so:

You can then cull the tidier-specific resources by calling cull():

You can also tidy up the culled resources by calling handle():

Finally, you can unmark a culled resource by calling unmark() and passing in the individual resource:

What does it do?

The tidier is a simple class that provides a way to tidy up resources:

An example tidier might be for registered users that have not verified their email addresses. Culling will identify these users and mark them for deletion. Notifications will be sent to the resource owners, which are the users themselves, to let them know that their accounts will be deleted because the emails associated with their accounts haven't been verified. If they happen to verify their email addresses before being deleted, then they will be "unmarked". If nothing is done in time, however, then the unverified user accounts will be deleted.

Tidiers

Tidiers can be registered by name in the configuration file and must identify three items:

Cullers

A culler's job is to find resources that meet some criteria, mark them as culled, and notify the individual resource owners.

Cullers can be registered by name in the configuration file and must identifiy three parameters:

Optionally, a class that implements R4nkt\ResourceTidier\Actions\Contracts\CullsResources can be provided.

Unmarkers

An unmarker's job is to unmark an individual resource that has been previously marked.

Unmarkers can be registered by name in the configuration file and must identifiy a class that implements R4nkt\ResourceTidier\Actions\Contracts\UnmarksResource.

Optionally, any params that the unmarkers require can be provided.

Handlers

A handler's job is to handle the tidying up of any culled resources.

Handlers can be registered by name in the configuration file and must identifiy the following parameters:

Optionally, a class that implements R4nkt\ResourceTidier\Actions\Contracts\HandlesResources can be provided.

Finders

A finder's job is to find resources. They are used by cullers and handlers, but they perform the same general function. For cullers, they are to find resources that should be culled. For handlers, they are to find culled resources that should be tidied up.

Finders can be registered by name in the configuration file and must identifiy a class that implements R4nkt\ResourceTidier\Actions\Contracts\FindsResources.

Optionally, any params that the finders require can be provided.

Markers

A marker's job is to mark individual resources as having been culled.

Markers can be registered by name in the configuration file and must identifiy a class that implements R4nkt\ResourceTidier\Actions\Contracts\MarksResources.

Optionally, any params that the markers require can be provided.

Notifiers

A notifier's job is to notify individual resource owners that their resources have been culled and some sort of impending action is likely to take place.

Notifiers can be registered by name in the configuration file and must identifiy a class that implements R4nkt\ResourceTidier\Actions\Contracts\NotifiesResourceOwner.

Optionally, any params that the notifiers require can be provided.

Tasks

A task's job is to tidy up an individual resource.

Tasks can be registered by name in the configuration file and must identifiy a class that implements R4nkt\ResourceTidier\Actions\Contracts\ExecutesResourceTask.

Optionally, any params that the notifiers require can be provided.

Testing

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of laravel-resource-tidier with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^8.0
spatie/laravel-package-tools Version ^1.4.3
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 r4nkt/laravel-resource-tidier contains the following files

Loading the files please wait ....