In Laravel 9+, the default language directory has moved from /resources/lang to /lang. The Laravel Logger package was still using the old structure, which could cause confusion and conflicts.
Updated the package to support both Laravel 9+ and older versions:
- Moved language files from
/src/resources/lang/to/src/lang/ - Updated ServiceProvider to detect and use the appropriate structure
- Added backward compatibility for older Laravel versions
- Updated publish commands to support both structures
// Load translations from new Laravel 9+ structure if available, fallback to old structure
if (is_dir(__DIR__.'/lang/')) {
$this->loadTranslationsFrom(__DIR__.'/lang/', 'LaravelLogger');
} else {
$this->loadTranslationsFrom(__DIR__.'/resources/lang/', 'LaravelLogger');
}// Publish language files to Laravel 9+ structure if available, fallback to old structure
if (is_dir(__DIR__.'/lang/')) {
// Laravel 9+ structure
$this->publishes([
__DIR__.'/lang' => base_path('lang/vendor/'.$publishTag),
], $publishTag);
// Also publish to old structure for backward compatibility
$this->publishes([
__DIR__.'/lang' => base_path('resources/lang/vendor/'.$publishTag),
], $publishTag.'-legacy');
} else {
// Old structure fallback
$this->publishes([
__DIR__.'/resources/lang' => base_path('resources/lang/vendor/'.$publishTag),
], $publishTag);
}- ✅ Laravel 9+ Compatible - Uses new
/langdirectory structure - ✅ Backward Compatible - Still works with older Laravel versions
- ✅ No Breaking Changes - Existing installations continue to work
- ✅ Future Proof - Ready for Laravel 10+ and beyond
php artisan vendor:publish --tag=LaravelLogger
# Language files will be published to /lang/vendor/LaravelLogger/php artisan vendor:publish --tag=LaravelLogger-legacy
# Language files will be published to /resources/lang/vendor/LaravelLogger/