artisanpack-ui/hooks
WordPress-style actions and filters for Laravel with helper functions, Action and Filter facades, and Blade directives. Register callbacks on named hooks, run them in priority order, and remove them when needed.
HookDeprecations primitive for backwards-compatible hook renaming
deprecateHook(string $old, string $new): void helper registers a rename in one lineAction and Filter transparently route add()/remove()/removeAll() through the alias mapdo() / apply() fan out across canonical and alias buckets so pre-deprecation subscribers still fire[$obj, 'method'], [Class::class, 'staticMethod'], and string function names all key correctly). Deliberate double-registrations within a single bucket still fire twicedeprecateHook('a', 'b') followed by deprecateHook('b', 'a') throws InvalidArgumentException instead of silently creating a b → b self-aliasdo/apply), never on add/remove — so the log entry is anchored to real hook use, not to boot-time registrationconfig/artisanpack/hooks.php (deprecation_level key), falling back to HOOKS_DEPRECATION_LEVEL env for zero-config use. Any PSR-3 level (emergency, alert, critical, error, warning, notice, info, debug) is accepted; off suppresses the logRequestReceived and Queue JobProcessing so long-lived workers do not swallow every notice after the first request/jobHookDeprecations is container-resolvable via app(HookDeprecations::class) — no new Facade or helper surface beyond deprecateHook()config/hooks.php, publishable via php artisan vendor:publish --tag=hooks-configsrc/Concerns/ManagesHookBuckets.php trait shared by Action and Filter, so bucket / alias / dedup / removal logic lives in one place instead of duplicated across both classesap.google.scopes, ap.icons.registerIconSets)illuminate/support constraint now accepts ^13.0illuminate/support constraint to ^11.0|^12.0|^13.0 to match the actively tested matrix>=5.3 constraint was overly permissive; the package was only ever tested against Laravel 10/11. Users on Laravel 10 or earlier should pin to ^1.2.0.resources/boost/guidelines/core.blade.php for AI-assisted developmentlaravel/pint package for PHP code formattingartisanpack-ui/code-style-pint package for ArtisanPackUI presetpint-setup.php script for generating Pint configurationpint.json configuration with ArtisanPackUI coding standardsAction::remove(string $hook, callable $callback, int $priority = 10): boolAction::removeAll(string $hook, int|false $priority = false): boolFilter::remove(string $hook, callable $callback, int $priority = 10): boolFilter::removeAll(string $hook, int|false $priority = false): boolremoveAction(), removeAllActions(), removeFilter(), removeAllFilters()Action::remove(), Action::removeAll(), Filter::remove(), Filter::removeAll()Action class for registering and executing action hooksFilter class for registering and applying filtersaddAction(string $hook, callable $callback, int $priority = 10) - Register action callbacksdoAction(string $hook, mixed ...$args) - Execute action callbacksaddFilter(string $hook, callable $callback, int $priority = 10) - Register filter callbacksapplyFilters(string $hook, mixed $value, mixed ...$args) - Apply filter callbacksAction facade for action managementFilter facade for filter management[@action](https://github.com/action)('hook_name', $args...) - Execute actions in Blade views[@filter](https://github.com/filter)('hook_name', $value, $args...) - Apply filters and echo results in Blade viewsHooksServiceProvider - Registers Action and Filter singletonsBladeDirectiveServiceProvider - Registers custom Blade directivesAction and FilterArtisanPackUI\Hooks\How can I help you explore Laravel packages today?