larapack/voyager-hooks
Larapack Voyager Hooks adds a flexible hook system to Laravel Voyager, letting developers run custom callbacks at key points in the admin panel without touching core files. Ideal for extending Voyager BREAD, forms, and UI behavior cleanly.
Start from a working Voyager 1.x admin panel and confirm the Laravel/PHP versions in composer.lock; this package’s last release was 2020, so compatibility is the first thing to verify.
composer require larapack/voyager-hooks
config/app.php.php artisan config:clear
php artisan view:clear
vendor/larapack/voyager-hooks/src for doAction / applyFilters calls. The actual hook names in your installed Voyager version are the source of truth.routes/web.php, for example an admin-only dashboard notice or an extra menu link. Confirm it fires in the Voyager admin, then remove it or gate it by role.The first practical use case is usually presentation-level: inject a banner, script, menu item, or small widget into Voyager admin screens without overriding Voyager views.
app/Providers/VoyagerHooksServiceProvider.php and keep boot() declarative. This makes admin hooks easy to disable, test, and audit.Hook::addAction('voyager.dashboard', DashboardNotice::class);
Hook::addFilter('voyager.bread.before_save', NormalizeBreadData::class);
Replace hook names with the ones exposed by your installed package version.vendor/ for the exact doAction/applyFilters call, or centralize names as constants. Add temporary logging inside callbacks when a hook “doesn’t fire.”return in a filter callback can break admin pages in confusing ways.config:clear, view:clear, and route cache clears solve many “my hook disappeared” reports.How can I help you explore Laravel packages today?