定制 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
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 6

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固