Add route for getting the current hubs

This commit is contained in:
Nabeel Shahzad
2018-01-05 15:30:35 -06:00
parent 927be50d9b
commit 60256ab213
4 changed files with 54 additions and 4 deletions

View File

@@ -49,4 +49,18 @@ abstract class BaseRepository extends \Prettus\Repository\Eloquent\BaseRepositor
{
return $this->orderBy($sort_by, 'desc')->paginate($count);
}
/**
* Find records with a WHERE clause but also sort them
* @param $where
* @param $sort_by
* @param $order_by
* @return $this
*/
public function whereOrder($where, $sort_by, $order_by)
{
return $this->scopeQuery(function($query) use ($where, $sort_by, $order_by) {
return $query->where($where)->orderBy($sort_by, $order_by);
});
}
}