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(11mo ago)04MITPHPPHP ^8.1

Since Jul 27Pushed 11mo 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 today

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

29

—

LowBetter than 57% of packages

Maintenance51

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

342d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/68514362?v=4)[Amzil Ayoub](/maintainers/amzil-ayoub)[@amzil-ayoub](https://github.com/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

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)

PHPackages © 2026

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