selahattinunlu / laravel-api-query-builder

Laravel & Lumen Api Query Builder Package
332 stars 66 forks source link

Default orderBy #25

Closed robsontenorio closed 7 years ago

robsontenorio commented 7 years ago

api-query-builder.php

return [
    'limit' => 15,
    'orderBy' => [
        [
            'column' => 'id',
            'direction' => 'desc'
        ]
    ],
    'excludedParameters' => [],
];

The problem is some old fashioned DB has no column "ID".

ERROR:  "ID": invalid identifier
SELECT * from "USERLAGCY" order by "ID" desc 

So, it would be usefull if we just ignore "order by" statment on query builder.

    'orderBy' => [
        [
            'column' => null,
            'direction' => null
        ]
.
.
or
.
.
    'orderBy' => []
.
.
.
    'orderBy' => null

@selahattinunlu

robsontenorio commented 7 years ago

sorry, 'orderBy' => [] already works