PHPackages                             fzengin19/laravel-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. fzengin19/laravel-approval

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

fzengin19/laravel-approval
==========================

Laravel için onay sistemi paketi

v1.1.0(1mo ago)10[3 PRs](https://github.com/fzengin19/laravel-approval/pulls)MITPHPPHP ^8.3CI passing

Since Jul 25Pushed 1mo agoCompare

[ Source](https://github.com/fzengin19/laravel-approval)[ Packagist](https://packagist.org/packages/fzengin19/laravel-approval)[ Docs](https://github.com/fzengin19/laravel-approval)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/fzengin19-laravel-approval/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (27)Versions (7)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/127501acfe7eeaad598ce11532b6453152ced4090dccfe201184d18355c917b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667a656e67696e31392f6c61726176656c2d617070726f76616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fzengin19/laravel-approval)[![GitHub Tests Action Status](https://camo.githubusercontent.com/2b128152decc2df486f91296094c2339fb9463ebeb6642790adc2a451ce8c6d6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f667a656e67696e31392f6c61726176656c2d617070726f76616c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/fzengin19/laravel-approval/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/30178c36a9773c9fb53490676ce3d9eaa9481b1784682779c65c6d9550e0edfe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f667a656e67696e31392f6c61726176656c2d617070726f76616c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/fzengin19/laravel-approval/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/0057847f62e17587905684c7b0aa4045f23b2bdc9fbb928bd975bdba4f3f5b10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667a656e67696e31392f6c61726176656c2d617070726f76616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fzengin19/laravel-approval)[![Code Coverage Status](https://camo.githubusercontent.com/bd9c9f17cd13137030eea24c1e719418ba56cf4e3e126d214113a906f3976e5e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f667a656e67696e31392f6c61726176656c2d617070726f76616c3f7374796c653d666c61742d737175617265)](https://codecov.io/gh/fzengin19/laravel-approval)

A comprehensive approval system package for PHP 8.3+ and Laravel 10+. It provides a flexible way to manage approval statuses for your models. Developed with a TDD approach, with reliable code and high test coverage.

✨ Features
----------

[](#-features)

- 🚀 **Easy Integration**: Integrate your models with approval system by just adding a trait.
- ⚙️ **Flexible Configuration**: Two different modes (insert/upsert) and customizable settings.
- 💡 **Configurable Initial State**: Define a default status for models that haven't been through an approval process yet.
- 🧠 **Smart Rejection Handling**: Normalizes unknown rejection reasons to `other` while preserving the original text in the comment.
- 🔍 **Global Scope**: Automatically show only approved records with configurable behavior.
- 🔔 **Comprehensive Event System**: 6 events with clear before/after transition timing and `causedBy` payloads.
- 📊 **Statistics Service**: Built-in statistics calculation with percentages and model-specific data.
- 🎭 **Facade Support**: Static API for easy usage with full IDE support.
- 🖥️ **Artisan Commands**: View statistics via CLI with table formatting.
- 🔧 **Repository Pattern**: Clean data access layer with insert/upsert modes.
- 🛡️ **Validation System**: Input validation with business rule enforcement.
- 🌐 **Webhook Support**: Configurable webhook endpoints for external integrations.
- 🎯 **Model-specific Configuration**: Override settings per model with inheritance.
- 🔄 **Auto Pending**: Automatically set models to pending status on creation.
- 🔗 **Polymorphic Approval Audit Trail**: Approval records keep a polymorphic `causer` relation to the configured user model.
- ✨ **Modern PHP**: Utilizes PHP 8.3+ features and enums for type-safe statuses.
- 📈 **Performance Optimized**: Indexed database fields and efficient queries.

🚀 Quick Start
-------------

[](#-quick-start)

### 1. Installation

[](#1-installation)

```
composer require fzengin19/laravel-approval
```

### 2. Publish and Migrate

[](#2-publish-and-migrate)

```
php artisan vendor:publish --provider="LaravelApproval\LaravelApprovalServiceProvider"
php artisan migrate
```

### 3. Add Trait to Your Model

[](#3-add-trait-to-your-model)

```
