Commit 36363216 authored by Taylor Otwell's avatar Taylor Otwell

fixed casing issues in inflection.

parent ea13ddfb
......@@ -133,7 +133,11 @@ class Str {
*/
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 @@ class Str {
{
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;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment