Install the package via Composer:
composer require vendor/package-name
After installation, the package now stores its configuration in the root directory (e.g., config/package-name.php) instead of a subdirectory. Run:
php artisan vendor:publish --provider="Vendor\Package\ServiceProvider" --tag="config"
to publish the config file to the expected location. The package now uses yiisoft/composer-config-plugin for dependency resolution, which may require updating your composer.json to include:
{
"config": {
"optimize-autoloader": true,
"preferred-install": "dist"
},
"extra": {
"yiisoft/composer-config-plugin": {
"include": ["vendor/package-name"]
}
}
}
config/ directory. Update your IDE to recognize the new path for autocompletion.yiisoft/composer-config-plugin for optimized autoloading. Ensure your composer.json includes the extra config block to avoid autoloader conflicts.config/caching or environment variables to override settings without modifying the published config directly.yiisoft/composer-config-plugin is compatible with your project’s Composer version (tested on Composer 2+).config/package-name/ to config/package-name.php. Update any hardcoded paths in your codebase or CI/CD pipelines.composer.json if needed:
"config": {
"platform-check": false,
"platform": {
"php": "8.0"
}
}
--tag="config" flag is used and the provider is registered in config/app.php.composer dump-autoload --optimize
composer config extra.yiisoft/composer-config-plugin null
config/app.php under the package-name key if needed:
'package-name' => [
'path' => 'custom/path/to/config.php',
],
yiisoft/composer-config-plugin behavior by adding custom rules to the extra section of composer.json.The yiisoft/composer-config-plugin may slightly increase build times during composer install. For production, ensure optimize-autoloader is enabled in composer.json.
How can I help you explore Laravel packages today?