Releases: datomatic/laravel-enum-helper
Releases · datomatic/laravel-enum-helper
v0.4.5
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0
- changed the translation key from
name
toname/value
for using the more comfortable invokable functionality on enums.php - added a translation fallback for description property translations
Example of new translation file
// /lang/it/enums.php
return [
// If you need to translate just the description property
Status::class => [
Status::PENDING() => 'In attesa', // using invokable trait functionality
'ACCEPTED' => 'Accettato', // using the name of pure enum case
'DISCARDED' => 'Rifiutato',
'NO_RESPONSE' => 'Nessuna Risposta',
],
// If you need to translate multiple properties (e.g. description, excerpt)
StatusString::class => [
'description' => [ // using invokable trait functionality
StatusString::PENDING() => 'In attesa',
StatusString::ACCEPTED() => 'Accettato',
...
],
'excerpt' => [ // using the value of BackedEnum case
"P" => 'In attesa',
"A" => 'Accettato',
...