raulfraile/ladybug-installer
Composer installer for Ladybug, a PHP variable dumper/debug tool. Adds automatic setup during package installation so Ladybug integrates smoothly into your project with minimal manual configuration.
Installation Add the package via Composer:
composer require raulfraile/ladybug-installer
Publish the config file (if available) with:
php artisan vendor:publish --provider="LadybugInstaller\LadybugInstallerServiceProvider"
Basic Usage
The package provides a unified installer for Ladybug addons (likely Laravel packages or extensions). Start by checking the config/ladybug-installer.php for available addons and their configurations.
First Use Case Install an addon via Artisan:
php artisan ladybug:install <addon-name>
Verify installation by checking the config/ladybug.php (or equivalent) for updated settings.
Addon Discovery
Use the LadybugInstaller facade to programmatically list available addons:
$addons = LadybugInstaller::available();
Iterate over them to build a custom installer UI (e.g., in a Laravel Nova tool or admin panel).
Conditional Installation Check if an addon is already installed before running the installer:
if (!LadybugInstaller::isInstalled('addon-name')) {
LadybugInstaller::install('addon-name');
}
Post-Install Hooks Extend the installer by publishing custom post-install logic:
LadybugInstaller::extend('addon-name', function () {
// Run migrations, seeders, or other setup tasks
});
Bulk Operations Install multiple addons in a single command:
LadybugInstaller::install(['addon1', 'addon2', 'addon3']);
Outdated Package
spatie/laravel-package-tools for modern package development).Missing Documentation
vendor/raulfraile/ladybug-installer) for undocumented features.LadybugInstallerServiceProviderLadybugInstaller facadeInstaller class (core logic).Config Overrides
config/ladybug-installer.php:
'addons' => [
'addon-name' => [
'config_path' => 'custom/path/to/config.php',
],
],
Dependency Conflicts
composer why-not to debug:
composer why-not laravel/framework 8.*
Enable Debug Mode
Set debug to true in config/ladybug-installer.php to log installation steps:
'debug' => env('APP_DEBUG', false),
Check Installation Logs Tail Laravel logs during installation:
tail -f storage/logs/laravel.log
Manual Installation Fallback If the installer fails, manually:
vendor/ or packages/.composer dump-autoload.Custom Addon Definitions Dynamically register addons via service provider:
LadybugInstaller::addAddon('custom-addon', [
'installer' => CustomAddonInstaller::class,
'config' => 'custom-config',
]);
Override Installer Logic Bind a custom installer class to an addon:
LadybugInstaller::macro('install', function ($addon) {
// Custom logic here
});
Event Listeners
Listen for LadybugInstaller.Installed events to trigger post-install actions:
Event::listen('LadybugInstaller.Installed', function ($addon) {
// Example: Send Slack notification
});
How can I help you explore Laravel packages today?