Add initial translations for enumerated values
This commit is contained in:
@@ -17,12 +17,16 @@ namespace App\Models\Enums;
|
||||
class EnumBase
|
||||
{
|
||||
protected static $labels = [];
|
||||
protected static $adverbs = [];
|
||||
|
||||
/**
|
||||
* Return the label, try to return the translated version as well
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function label($value) {
|
||||
return self::$labels[$value];
|
||||
if(isset(static::$labels[$value])) {
|
||||
return trans(static::$labels[$value]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user