Skip to content

Releases: datomatic/laravel-enum-helper

v0.4.5

01 Jul 08:59
Compare
Choose a tag to compare
  • refactored humanize case string method
  • added test to cover all cases
  • refactored documentation

v0.4.4

30 Jun 17:15
Compare
Choose a tag to compare
  • added a fallback to the case name on description "property"

v0.4.3

30 Jun 12:02
Compare
Choose a tag to compare
  • improved the TranslationMissing exception message

v0.4.2

27 Jun 14:41
Compare
Choose a tag to compare
  • fixed error with IntBackedEnum

v0.4.1

27 Jun 08:01
43c131f
Compare
Choose a tag to compare

refactoring by @eppak

v0.4.0

25 Jun 13:57
Compare
Choose a tag to compare
  • changed the translation key from name to name/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',
    ...

v0.3.0

21 Jun 07:12
Compare
Choose a tag to compare
  • rename LaravelEnum trait in LaravelEnumHelper

v0.2.1

20 Jun 10:11
Compare
Choose a tag to compare
  • fixed return of invokable static call on IntBackedEnum

v0.2.0

18 Jun 10:56
Compare
Choose a tag to compare
  • permit to use of "property" name that has name both singular and plural
  • updated banners