Created
May 19, 2020 15:49
-
-
Save pravodev/9ded3dee5ed9b35489c91933f9f5e4c4 to your computer and use it in GitHub Desktop.
Extending Laravel Collection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Support\Collection as BaseCollection; | |
class Collection extends BaseCollection | |
{ | |
public function toUpper() | |
{ | |
return $this->map(function($value){ | |
return strtoupper($value); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment