承接 alizharb/laravel-hooks 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alizharb/laravel-hooks

最新稳定版本:v1.2.1

Composer 安装命令:

composer require alizharb/laravel-hooks

包简介

A universal extensibility and plugin system for Laravel 12 applications.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads License PHP Stan

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

  • Actions & 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 & Queued: Dispatch heavy actions to Laravel Queue via Hook::queueAction.
  • 🔍 Inspector & 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

composer require alizharb/laravel-hooks

📚 Documentation

🚀 Quick Start

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

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

Run the test suite:

composer test

🌏 Ecosystem

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

💖 Sponsors

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

📄 License

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

Made with ❤️ by Ali Harb

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 6

GitHub 信息

  • Stars: 7
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-15