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.Action class for registering and executing action hooks\n- Support for callback priorities (lower numbers execute first)\n- Filter system for value transformation through callback chains\n- Filter class for registering and applying filters\n- Chained value processing with multiple callbacks\n- Helper functions for easy integration:\n- addAction(string , callable , int = 10) - Register action callbacks\n- doAction(string , mixed ...) - Execute action callbacks\n- addFilter(string , callable , int = 10) - Register filter callbacks\n- applyFilters(string , mixed , mixed ...) - Apply filter callbacks\n- Laravel Facades for static access:\n- Action facade for action management\n- Filter facade for filter management\n- Blade directives for template integration:\n- [@action](https://github.com/action)('hook_name', ...) - Execute actions in Blade views\n- [@filter](https://github.com/filter)('hook_name', , ...) - Apply filters and echo results in Blade views\n- Service providers with automatic Laravel package discovery:\n- HooksServiceProvider - Registers Action and Filter singletons\n- BladeDirectiveServiceProvider - Registers custom Blade directives\n- Automatic facade alias registration for Action and Filter\n- PSR-4 autoloading with namespace ArtisanPackUI\Hooks\\n- Comprehensive test suite using Pest testing framework\n- Full documentation with examples and usage guidelines\n### Requirements\n- PHP 8.2 or higher\n- Laravel 5.3+ (tested with Laravel 10.x and 11.x)\n- Illuminate/Support package\n### Features\n- Priority-based callback execution (lower numbers run first)\n- Modular architecture supporting plugin-style extensions\n- Clean separation of concerns for maintainable code\n- Framework-native Laravel integration\n- MIT license for open source usageAction::remove(string , callable , int = 10): bool\n- Action::removeAll(string , int|false = false): bool\n- Filter removal APIs:\n- Filter::remove(string , callable , int = 10): bool\n- Filter::removeAll(string , int|false = false): bool\n- Helper functions:\n- removeAction(), removeAllActions(), removeFilter(), removeAllFilters()\n- Facade methods documented: Action::remove(), Action::removeAll(), Filter::remove(), Filter::removeAll()\n- Unit tests for removal behaviors\n- Documentation updates with examples and API referencesresources/boost/guidelines/core.blade.php for AI-assisted development\n- Comprehensive package documentation for Laravel Boost users\n- Code examples for actions, filters, priorities, and Blade directives\n- Laravel Pint code style support\n- Added laravel/pint package for PHP code formatting\n- Added artisanpack-ui/code-style-pint package for ArtisanPackUI preset\n- Added pint-setup.php script for generating Pint configuration\n- Added pint.json configuration with ArtisanPackUI coding standards\n- GitLab CI Pint code style job\n- Automated code style checking using Pint in CI pipeline\n- Configured as non-blocking (allow_failure: true)\n### Changed\n- GitLab CI configuration standardized to PHP 8.4\n- Updated build stage to use PHP 8.4 with Composer\n- Updated test stage to use PHP 8.4\n- Updated code-style stage to use PHP 8.4\n- Added installation of git, unzip, and PHP zip extension in build stage\n- Ensures consistent PHP version across all CI jobs\n- Updated Symfony dependencies to v7.3.7 (security update)\n- Fixed security advisory PKSA-365x-2zjk-pt47 in symfony/http-foundation\n### Development\n- Improved CI/CD pipeline reliability\n- Enhanced code quality tools with Pint integrationHow can I help you explore Laravel packages today?