fixed casing issues in inflection.
This commit is contained in:
parent
ea13ddfb7f
commit
363632165c
|
@ -133,7 +133,11 @@ public static function limit($value, $limit = 100, $end = '...')
|
||||||
*/
|
*/
|
||||||
public static function singular($value)
|
public static function singular($value)
|
||||||
{
|
{
|
||||||
return array_get(array_flip(Config::get('strings.inflection')), strtolower($value), $value);
|
$inflection = Config::get('strings.inflection');
|
||||||
|
|
||||||
|
$singular = array_get(array_flip($inflection), strtolower($value), $value);
|
||||||
|
|
||||||
|
return (ctype_upper($value[0])) ? static::title($singular) : $singular;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -156,7 +160,9 @@ public static function plural($value, $count = 2)
|
||||||
{
|
{
|
||||||
if ((int) $count == 1) return $value;
|
if ((int) $count == 1) return $value;
|
||||||
|
|
||||||
return array_get(Config::get('strings.inflection'), strtolower($value), $value);
|
$plural = array_get(Config::get('strings.inflection'), strtolower($value), $value);
|
||||||
|
|
||||||
|
return (ctype_upper($value[0])) ? static::title($plural) : $plural;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue