PHPackages                             traknpay/laravel-eloquent-approval - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. traknpay/laravel-eloquent-approval

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

traknpay/laravel-eloquent-approval
==================================

Approval Package For Laravel Eloquent Model

1.4(2y ago)94665[1 issues](https://github.com/TraknPay/laravel-eloquent-approval/issues)[3 PRs](https://github.com/TraknPay/laravel-eloquent-approval/pulls)MITPHPPHP ^7.0|^8.0

Since Oct 21Pushed 1y ago2 watchersCompare

[ Source](https://github.com/TraknPay/laravel-eloquent-approval)[ Packagist](https://packagist.org/packages/traknpay/laravel-eloquent-approval)[ RSS](/packages/traknpay-laravel-eloquent-approval/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (2)Versions (7)Used By (0)

Laravel Eloquent Approval
=========================

[](#laravel-eloquent-approval)

Approval process for Laravel's Eloquent models.

How it works?
-------------

[](#how-it-works)

New entities are created in the 'approval' table as *pending* and then can become *approved* or *rejected*.

Install
-------

[](#install)

```
$ composer require traknpay/laravel-eloquent-approval
```

### Version Compatibility

[](#version-compatibility)

Laravel VersionPackage Version5.6.\*^1.0Setup
-----

[](#setup)

### Registering the service provider

[](#registering-the-service-provider)

By default the service provider is registered automatically by Laravel package discovery otherwise you need to register it in your `config\app.php`

```
TraknPay\EloquentApproval\ApprovalServiceProvider::class
```

Run the following commands to migrate the 'approval' table:

```
php artisan vendor:publish --provider='TraknPay\EloquentApproval\ApprovalServiceProvider'

php artisan migrate
```

### Model

[](#model)

Add `ApprovalTrait` trait to the model and override the `isApprover()` function as per your need.

```
use Illuminate\Database\Eloquent\Model;
use TraknPay\EloquentApproval\ApprovalTrait;

class Entity extends Model
{
    use ApprovalTrait;

    public static function isApprover(): bool
    {
        return true;
    }
}
```

By default `isApprover()` is true and if you use this trait, it will not put the new entities in the `approval` table. You can override this functionality based on your need. If `isApprover()` function returns false then entities are added to `approval` table and mark the transaction as false. Hence, if 'isApprover()' returns false the model will not be persited to database instead added to 'approval' table for approval. For example, in this function you can check whether user has permission to approve or not.

\##Approval Events

Following model events are dispatched before and after saving data into 'approval' table.

1. `sendingForApproval` - before saving data into 'approval' table.
2. `sentForApproval` - after saving data into 'approval' table.

Inspirations
------------

[](#inspirations)

I got some inspiration from [mtvs/eloquent-approval](https://github.com/mtvs/eloquent-approval) package. Even though , I wrote my own package for my project purpose I got some insights on how to write my own package from this.

###  Health Score

36

↑

LowBetter than 82% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 76.5% 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 ~482 days

Total

5

Last Release

832d ago

PHP version history (2 changes)1.0PHP ^7.0

1.4PHP ^7.0|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11293052?v=4)[Karmendra Suthar](/maintainers/karmendra)[@karmendra](https://github.com/karmendra)

---

Top Contributors

[![Shari18](https://avatars.githubusercontent.com/u/15686465?v=4)](https://github.com/Shari18 "Shari18 (13 commits)")[![karmendra](https://avatars.githubusercontent.com/u/11293052?v=4)](https://github.com/karmendra "karmendra (4 commits)")

### Embed Badge

![Health badge](/badges/traknpay-laravel-eloquent-approval/health.svg)

```
[![Health](https://phpackages.com/badges/traknpay-laravel-eloquent-approval/health.svg)](https://phpackages.com/packages/traknpay-laravel-eloquent-approval)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[glhd/special

1929.4k](/packages/glhd-special)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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