PHPackages                             sbamtr/laravel-auto-hard-deleter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. sbamtr/laravel-auto-hard-deleter

Abandoned → [laravel/framework](/?search=laravel%2Fframework)ArchivedLibrary[Database &amp; ORM](/categories/database)

sbamtr/laravel-auto-hard-deleter
================================

Laravel Auto Hard Deleter

1.3.0(4y ago)471803MITPHPPHP &gt;=7.2.5CI failing

Since Feb 17Pushed 8mo ago2 watchersCompare

[ Source](https://github.com/SiavashBamshadnia/Laravel-Auto-Hard-Deleter)[ Packagist](https://packagist.org/packages/sbamtr/laravel-auto-hard-deleter)[ RSS](/packages/sbamtr-laravel-auto-hard-deleter/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (4)Versions (9)Used By (0)

Laravel Auto Hard Deleter
=========================

[](#laravel-auto-hard-deleter)

Important

**Archived** – This package is no longer maintained.
Laravel now provides a built-in way to prune and automatically delete old models using the [Prunable and MassPrunable traits](https://laravel.com/docs/eloquent#pruning-models).
Please use Laravel's native pruning feature instead.

### Example with Laravel Prunable

[](#example-with-laravel-prunable)

```
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Prunable;

class SampleModel extends Model
{
    use SoftDeletes, Prunable;

    /**
     * Define which records should be pruned.
     */
    public function prunable()
    {
        // Delete records soft deleted more than 30 days ago
        return static::where('deleted_at', '
