laravel/framework — pull request #1246 by helmut (2013-05-08 23:26:37+00:00)
Title: Pluralizer Case Sensitivity

I understand that this has been discussed before but this issue keeps bugging me so I thought I would have a crack at solving it in the cleanest way I could find in the hopes of a change of heart. I have modified the pluralizer to maintain case sensitivity on irregular words and also fixes the case matching on uppercase regular words. For example...

```php
// Without my modification on a regular word
Str::plural('dog'); // echos 'dogs' - correct!
Str::plural('Dog'); // echos 'Dogs' - correct!
Str::plural('DOG'); // echos 'DOGs' - NOT correct
// And for an irregular word
Str::plural('child'); // echos 'children' - correct!
Str::plural('Child'); // echos 'children' - NOT correct
Str::plural('CHILD'); // echos 'children' - NOT correct
```
And if you accept this pull request.

```php
// With my modification on a regular word
Str::plural('dog'); // echos 'dogs' - correct!
Str::plural('Dog'); // echos 'Dogs' - correct!
Str::plural('DOG'); // echos 'DOGS' - correct!
// And for an irregular word
Str::plural('child'); // echos 'children' - correct!
Str::plural('Child'); // echos 'Children' - correct!
Str::plural('CHILD'); // echos 'CHILDREN' - correct!
```

Check out the implementation and if you sitll think this is too clunky then I will let it go but I think this is not a bad fix for the current inconsistency with the function.

Also discussed here #855