You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?The text was updated successfully, but these errors were encountered: