PHPackages                             ayoub-amzil/soft-delete-logger - 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. ayoub-amzil/soft-delete-logger

ActiveLibrary[Database &amp; ORM](/categories/database)

ayoub-amzil/soft-delete-logger
==============================

Log soft deletes and restore actions on Eloquent models with user tracking in Laravel.

1.1.0(9mo ago)04MITPHPPHP ^8.1

Since Jul 27Pushed 9mo agoCompare

[ Source](https://github.com/ayoub-amzil/soft-delete-logger)[ Packagist](https://packagist.org/packages/ayoub-amzil/soft-delete-logger)[ RSS](/packages/ayoub-amzil-soft-delete-logger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Soft Delete Logger
==================

[](#soft-delete-logger)

Log every soft delete and restore action on your Eloquent models — including the authenticated user who performed it.

📦 Installation
--------------

[](#-installation)

```
composer require ayoub-amzil/soft-delete-logger

```

🛠️ Setup
--------

[](#️-setup)

### 1. Publish the migration

[](#1-publish-the-migration)

```
php artisan vendor:publish --tag=soft-delete-logger-migrations

```

Then migrate:

```
php artisan migrate

```

### 2. Add the trait to your model

[](#2-add-the-trait-to-your-model)

```
use AyoubAmzil\SoftDeleteLogger\Traits\LogsSoftDeletes;

class Product extends Model
{
    use SoftDeletes, LogsSoftDeletes;
}
```

That’s it!

🔍 What it logs
--------------

[](#-what-it-logs)

Whenever a model is soft-deleted or restored, it logs:

- `model`: Class name of the model
- `model_id`: The ID of the deleted/restored record
- `user_id`: The ID of the currently authenticated user (or `null` if not logged in)
- `action`: Either `soft_deleted` or `restored`
- `timestamps`: When the action happened

📄 Log Table Example
-------------------

[](#-log-table-example)

idmodelmodel\_iduser\_idactioncreated\_at1App\\Models\\Post421soft\_deleted...2App\\Models\\Post421restored...✅ Compatibility
---------------

[](#-compatibility)

- Laravel 10+
- Works with any model using `SoftDeletes`

📄 License
---------

[](#-license)

[MIT](LICENSE)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance56

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

289d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab1bd32b06c03497ef0ffdb45d966028f4ac38a3b31536b27bcfdda63d604a30?d=identicon)[amzil-ayoub](/maintainers/amzil-ayoub)

---

Top Contributors

[![ayoub-amzil](https://avatars.githubusercontent.com/u/85901966?v=4)](https://github.com/ayoub-amzil "ayoub-amzil (5 commits)")

---

Tags

auditdatabaselaravellogsphpsoftdelete

### Embed Badge

![Health badge](/badges/ayoub-amzil-soft-delete-logger/health.svg)

```
[![Health](https://phpackages.com/badges/ayoub-amzil-soft-delete-logger/health.svg)](https://phpackages.com/packages/ayoub-amzil-soft-delete-logger)
```

###  Alternatives

[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[aglipanci/laravel-eloquent-case

Adds CASE statement support to Laravel Query Builder.

115157.2k](/packages/aglipanci-laravel-eloquent-case)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
