PHPackages                             alizharb/laravel-hooks - 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. alizharb/laravel-hooks

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

alizharb/laravel-hooks
======================

A universal extensibility and plugin system for Laravel 12 applications.

v1.2.1(4mo ago)7221MITPHPPHP ^8.2|^8.3CI passing

Since Jan 14Pushed 4mo agoCompare

[ Source](https://github.com/AlizHarb/laravel-hooks)[ Packagist](https://packagist.org/packages/alizharb/laravel-hooks)[ GitHub Sponsors](https://github.com/AlizHarb)[ RSS](/packages/alizharb-laravel-hooks/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (16)Versions (5)Used By (0)

Laravel Hooks
=============

[](#laravel-hooks)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bd2c833dba6f2ea08d8b83d7db338a30fed06ad642dedb854351bb139ad4f95e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c697a686172622f6c61726176656c2d686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alizharb/laravel-hooks)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6e573a6fb5c4490e33dab9832b2cf246f1976935fb1500d468fa359179165700/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f416c697a486172622f6c61726176656c2d686f6f6b732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/AlizHarb/laravel-hooks/actions?query=workflow%3Atests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/83560470969a252a7a4e02eb2b702e3f2b78a3fda6cf8882502719ad50400807/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f416c697a486172622f6c61726176656c2d686f6f6b732f70696e742e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/AlizHarb/laravel-hooks/actions?query=workflow%3APint+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ca0923fad162265a1e88bec6576bc70a996e1f4ae320bb22966f514a59c2d19f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c697a686172622f6c61726176656c2d686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alizharb/laravel-hooks)[![License](https://camo.githubusercontent.com/d021b1152264aa48cab0e8d6609710e9df8cadc61510cf07c5871a959b60c87d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616c697a686172622f6c61726176656c2d686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alizharb/laravel-hooks)[![PHP Stan](https://camo.githubusercontent.com/a072da58d5375ac0a020aff945c43855e5c0af8c8f820890ad9669b10eeb85ff/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f416c697a486172622f6c61726176656c2d686f6f6b732f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d5048505374616e267374796c653d666c61742d737175617265)](https://github.com/AlizHarb/laravel-hooks/actions?query=workflow%3APHPStan+branch%3Amain)

**Laravel Hooks** is a production-ready, universal extensibility system for **Laravel 12**. Inspired by WordPress but modernized with **PHP 8.5 attributes**, **Strict Typing**, and **Deep Laravel Integration**.

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

[](#-features)

- ⚡ **Actions &amp; Filters**: High-performance hook system (`addAction`, `applyFilters`).
- 🧬 **Model Extensions**: Declarative model extensions via Attributes or `Hook::model()` API.
- 🛡️ **Type-Safe**: Strict signatures contracts, `BackedEnum`, and DTO support.
- 🚦 **Circuit Breaker**: request-level failure protection for critical hooks.
- 🚀 **Async &amp; Queued**: Dispatch heavy actions to Laravel Queue via `Hook::queueAction`.
- 🔍 **Inspector &amp; Debugbar**: Real-time profiling with `laravel-debugbar` integration.
- 📊 **Pulse Integration**: Performance monitoring and hit counts via Laravel Pulse.
- 📦 **Ecosystem Ready**: Pipelines, Deprecations, IDE Help, and Auto-Docs generator.

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

[](#-installation)

```
composer require alizharb/laravel-hooks
```

📚 Documentation
---------------

[](#-documentation)

- [**Basics**](docs/basics.md): Actions, Filters, Priorities, and Attributes.
- [**Advanced Features**](docs/advanced.md): Typed Hooks, Wildcards, Scopes, Pipelines.
- [**Async &amp; Queue**](docs/async.md): Background processing.
- [**Ecosystem &amp; Safe DX**](docs/ecosystem.md): Signatures, Deprecations, IDE Helper, Compilation.
- [**Integrations**](docs/integrations.md): Debugbar, Eloquent, Blade.
- [**CLI Tooling**](docs/cli.md): Artisan commands.

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

[](#-quick-start)

### Basic Usage

[](#basic-usage)

```
use AlizHarb\LaravelHooks\Facades\Hook;

// Register
Hook::addAction('order.created', function ($order) {
    Log::info("Order #{$order->id} created");
});

// Dispatch
Hook::doAction('order.created', $order);
```

### Attribute Registration

[](#attribute-registration)

```
use AlizHarb\LaravelHooks\Attributes\HookFilter;

class contentModifier
{
    #[HookFilter('content.render', priority: 20)]
    public function addSignature($content)
    {
        return $content . "\n\n-- Sent via Laravel Hooks";
    }
}
```

🧪 Testing
---------

[](#-testing)

Run the test suite:

```
composer test
```

🌏 Ecosystem
-----------

[](#-ecosystem)

Laravel Hooks is part of a larger ecosystem designed for modular, extensible Laravel applications:

- [**Laravel Modular**](https://github.com/AlizHarb/laravel-modular): Build modular Laravel apps with zero configuration.
- [**Laravel Themer**](https://github.com/AlizHarb/laravel-themer): A powerful theme engine for Laravel applications.
- [**Filament Modular Luncher**](https://github.com/AlizHarb/filament-modular-luncher): The ultimate dashboard launcher for modular projects.
- [**Filament Themer Luncher**](https://github.com/AlizHarb/filament-themer-luncher): Professional theme switching for Filament.
- [**Modular JS**](https://github.com/AlizHarb/laravel-modular-js): Seamless asset management for Laravel modules.
- First-class bridges for [**Filament**](https://github.com/AlizHarb/laravel-modular-filament) and [**Livewire**](https://github.com/AlizHarb/laravel-modular-livewire).

💖 Sponsors
----------

[](#-sponsors)

If you find this package useful, please consider supporting its development:

- [**GitHub Sponsors**](https://github.com/sponsors/AlizHarb)

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

---

**Made with ❤️ by [Ali Harb](https://github.com/AlizHarb)**

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance74

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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 ~7 days

Total

4

Last Release

146d ago

PHP version history (2 changes)v1.0.0PHP ^8.3

v1.2.1PHP ^8.2|^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34816428?v=4)[Ali Harb](/maintainers/AlizHarb)[@AlizHarb](https://github.com/AlizHarb)

---

Top Contributors

[![AlizHarb](https://avatars.githubusercontent.com/u/34816428?v=4)](https://github.com/AlizHarb "AlizHarb (2 commits)")

---

Tags

pluginlaraveleventshooksfiltersactionswordpress-style

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alizharb-laravel-hooks/health.svg)

```
[![Health](https://phpackages.com/badges/alizharb-laravel-hooks/health.svg)](https://phpackages.com/packages/alizharb-laravel-hooks)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[laravel/folio

Page based routing for Laravel.

603583.7k33](/packages/laravel-folio)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)

PHPackages © 2026

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