Download the PHP package sbamtr/laravel-auto-hard-deleter without Composer

On this page you can find all versions of the php package sbamtr/laravel-auto-hard-deleter. 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-auto-hard-deleter

Laravel Auto Hard Deleter

PHP Composer Build Status StyleCI Latest Stable Version License PHP from Travis config CodeFactor

This package deletes soft deleted rows automatically after a time interval that you define.

For Laravel and Lumen 6, 7, 8, 9

Installation

Step 1

Require the package with composer using the following command:

Step 2

For Laravel

The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:

For Lumen

Add this line of code under the Register Service Providers section of your bootstrap/app.php:

Step 3

Now its the time for scheduling the command. in you app/Console/Kernel.php file, paste this code in schedule() function:

In the code above, the command scheduled to run hourly. you can change it. For more information, please read this page.

Step 4 (Optional)

You can publish the config file with this following command:

Note: If you are using Lumen, you have to use this package.

Also you can set the AUTO_HARD_DELETE_AFTER value in .env file. like the following code:

Usage

in your models that used SoftDeletes trait, you can enable Auto Hard Delete with this code:

Just write const AUTO_HARD_DELETE_ENABLED = true in your models! Also you can set expiration time for your deleted entities using the following line:

In the code above, expiration time for your soft deleted entity model is 5 months. The final code is:

You can set any other values for AUTO_HARD_DELETE_AFTER like 5(means 5 days), 2 hours, 45 days, 2.5 months, 1 year, etc.

Note: If you don't set any value for AUTO_HARD_DELETE_AFTER in your model, the soft deleted models with AUTO_HARD_DELETE_ENABLED = true will be hard deleted after the time defined in config file named auto-hard-deleter.php.

Auto Hard Delete Command

Also you can hard delete expired rows manually using this artisan command:

Written with ♥ by Siavash Bamshadnia

Please support me by staring this repository.


All versions of laravel-auto-hard-deleter with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.5
illuminate/console Version ^6|^7|^8|^9
illuminate/database Version ^6.20.12|^7.30.4|^8.22.1|^9
illuminate/support Version ^6|^7|^8|^9
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 sbamtr/laravel-auto-hard-deleter contains the following files

Loading the files please wait ....