joedixon / laravel-translation

Translation management for your Laravel application.
MIT License
694 stars 230 forks source link

Database: return empty collection when language does not exist on get… #266

Open tomderoo opened 1 year ago

tomderoo commented 1 year ago

Database: return empty collection when language does not exist on getSingleTranslationsFor a given language, to avoid operation on null.

Among other things, this avoids errors through third-party packages that call translations during artisan migrate and before the actual laravel-translation migrations have run - else we experience a fatal error that effectively prevents migration and causes all kinds of trouble on automated deployment systems.

This particular error came to light when attempting to set the driver to database on an existing Laravel project that included rinvex/countries and then running migrations.

CrazyFreeMan commented 1 year ago

Good! Need this fix, many errors generate this package :(