Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Hooks Laravel Package

artisanpack-ui/hooks

WordPress-style actions and filters for Laravel. Register callbacks on named hooks and filter values with helper functions, Facades, and Blade directives. Predictable priority order, auto-discovery, and support for removing specific or all callbacks.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Modular Architecture & Plugin System: Enables third-party package extensibility (e.g., analytics, payment gateways) via WordPress-style hooks, reducing tight coupling and easing future integrations. Ideal for SaaS platforms or marketplaces where vendors add functionality.
  • Event-Driven Workflows: Supports decoupled microservices by replacing direct service calls with action/filter hooks (e.g., order.placed → trigger inventory updates, notifications, and audits independently).
  • Dynamic UI Customization: Facilitates headless CMS or theming systems where Blade directives (@action, @filter) allow frontend teams to modify behavior without backend changes (e.g., dynamic pricing displays).
  • Build vs. Buy: Avoid reinventing hook systems for Laravel apps (vs. building custom event dispatchers or observers), saving dev time while maintaining flexibility.
  • Roadmap Priorities:
    • Phase 1: Integrate hooks for core workflows (e.g., user auth, order processing).
    • Phase 2: Expose hooks to API endpoints for extensibility (e.g., webhook.received).
    • Phase 3: Build a hook marketplace for community packages (monetization opportunity).

When to Consider This Package

  • Adopt if:
    • Your Laravel app requires plugin-like extensibility (e.g., e-commerce, CRM, or SaaS platforms).
    • You need predictable execution order for callbacks (priorities) without complex event queues.
    • Your team uses Blade templates and wants to offload logic to hooks (e.g., dynamic content filters).
    • You’re building a modular monolith or migrating to microservices and need a lightweight coordination layer.
  • Look elsewhere if:
    • You need real-time event streaming (use Laravel Events + Redis/Pusher).
    • Your app relies on complex workflows (use Laravel Tasks or Symfony Messenger).
    • You’re constrained by PHP 8.1 or lower (requires 8.2+).
    • You prefer React/Node.js-style middleware (use Laravel Middleware or Lumen Pipes).

How to Pitch It (Stakeholders)

For Executives: "This package lets us build a plug-and-play Laravel ecosystem—like WordPress for PHP. Teams can extend core functionality (e.g., payments, notifications) without rewriting the app. For example, a new analytics vendor could hook into user.activity without touching our codebase. It also enforces consistent code quality via Pint integration, reducing tech debt. Early adopters like [Hypothetical Company] cut feature delivery time by 30% using similar systems."

For Engineers: *"Think of this as Laravel’s missing do_action/apply_filters. Key benefits:

  • Actions: Fire callbacks for events (e.g., order.shipped) with priority control.
  • Filters: Chain value transformations (e.g., price.display → format currency).
  • Blade Directives: Move logic from controllers to templates (@filter('title', $post->title)).
  • Zero Boilerplate: Auto-registers providers/facades—just composer require and go. Use case: Replace if/else spaghetti in your OrderController with addAction('order.processed', ...) for cleaner, testable code."*

For Designers/Non-Tech: "This lets developers hook into the app’s ‘events’—like when a user signs up or an order ships—so they can add features without breaking existing ones. For example, we could add a new ‘loyalty points’ system later without touching the checkout code."

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor