Closed macias67 closed 7 years ago
I fixed this by commenting $this->orderBy = config('api-query-builder.orderBy'); on the QueryBuilder constructor class
Hi @Macias67 and @GustavoHekel Firstly, I'm sorry, I'm late.
There is multiple way for this.
return [
'limit' => 15,
'orderBy' => [
[
'column' => 'id',
'direction' => 'desc'
]
],
'excludedParameters' => [],
];
to
return [
'limit' => 15,
'orderBy' => [],
'excludedParameters' => [],
];
So, there is no default configuration anymore.
class YourQueryBuilder extends QueryBuilder
{
public function __construct(Model $model, Request $request)
{
parent::__construct($model, $request);
$this->orderBy = [];
}
}
I hope I could help you.
I have a table with a primary key like this "model_id", I do not using "id", so what is the best way to override the array configuration (
config/api-query-builder.php
)?