I'm using Backpack for Laravel, Crud module.
How to use orderby() for multiple columns?
example:
$this->crud->orderBy('name','desc')->orderBy('year,'asc');
I have seen the src and the orderby accepts only one parameter.
Any suggestion?
I'm using Backpack for Laravel, Crud module.
How to use orderby() for multiple columns?
example:
$this->crud->orderBy('name','desc')->orderBy('year,'asc');
I have seen the src and the orderby accepts only one parameter.
Any suggestion?
You should be able to chain any number of orderBy
methods to CRUD's query
property, which is the actual query that will be executed:
$this->crud->query = $this->crud->query->orderBy('name', 'desc')->orderBy('year', 'asc');