How do we create a new Eloquent Collection in Laravel 4, without using Query Builder?
There is a newCollection()
method which can be overridden by that
It is better to use the Injection Pattern and after $this->collection->make([])
than new Collection
use Illuminate\Support\Collection;
...
// Inside of a clase.
...
public function __construct(Collection $collection){
$this->collection = $collection;
}
public function getResults(){
...
$results = $this->collection->make([]);
...
}