spatie/laravel-translatable
Adds HasTranslations to Eloquent models to store translations in JSON columns—no extra tables. Define translatable attributes via PHP 8 attribute or $translatable property, then set/get per-locale values while model accessors return the current app locale.
You can forget a translation for a specific field using the forgetTranslation function:
public function forgetTranslation(string $attributeName, string $locale)
Here's an example:
$newsItem->forgetTranslation('name', 'nl');
You can forget all translations for a specific locale:
public function forgetAllTranslations(string $locale)
Here's an example:
$newsItem->forgetAllTranslations('nl');
How can I help you explore Laravel packages today?