class ChildRepository extends \Bosnadev\Repositories\Eloquent\Repository
{
public function model() {}
public function suggest($column, $search)
{
return $this->getByCriteria(new Like($column, $search))
->all(['id', \DB::raw("{$column} as name")]);
}
}
all() returns EloquentCollection, and does not allow additional method chaining.
Before extending this package it was,
public function suggest($column, $query)
{
return $this->model->where($column, 'like', $query . '%')
->orderBy($column, 'asc')->get(['id', \DB::raw("{$column} as name")]);
}
What is the best way I can chain orderBy() with \Bosnadev\Repositories\Eloquent\Repository. Do I have to make a OrderBy Criteria?
In my child repository...
all() returns EloquentCollection, and does not allow additional method chaining.
Before extending this package it was,
What is the best way I can chain orderBy() with
\Bosnadev\Repositories\Eloquent\Repository
. Do I have to make aOrderBy
Criteria?