Skip to content

Instantly share code, notes, and snippets.

@pravodev
Created May 19, 2020 15:49
Show Gist options
  • Save pravodev/9ded3dee5ed9b35489c91933f9f5e4c4 to your computer and use it in GitHub Desktop.
Save pravodev/9ded3dee5ed9b35489c91933f9f5e4c4 to your computer and use it in GitHub Desktop.
Extending Laravel Collection
<?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