Sorting multiple tables in one request
See more http://stackoverflow.com/q/40612147/1564365
something like
@sortablelink('username','user name', ['prefix' => 'abc'])
where ['prefix' => 'abc'] is identifier of "sorting instance"
which may be simplified to
@sortablelink('username','user name', 'abc')
Hmm, I just ran into this: multiple tables being grabbed in one request but sortable() is only applied to the first one:
$customers = $customer->sortable(['ChangeDate' => 'desc'])
->take(10)
->get();
$contacts = $contact->sortable(['Name' => 'asc'])
->take(10)
->get();
I like the "sorting instance" idea, and they could be chained together in the request so the tables retain their sorting when another one is sorted as well: /dashboard?sort=contact.ChangeDate&order=contact.desc&sort=customer.Name&order=customer.asc
@gmask yes, think about it you are trying to sort two models but you have only one url bar... You can not sort more than one model per request with this package.
Unless I introduce some kind of trickery with sessions (non persistent) or simply base64 encoded sorting = not good looking for end user.
Upon writing original issue I forgot that 3rd parameter already used for different purposes.
i have the same issue as @gmask in my code, i have pages where i use sorted models but without links
Why would you use this package without using it in views? If you don't need links just sort your data manually.
Sortable package can be used only once per request because it relies on whatever data are sent through GET parameters (sort, order).
Yeah, you are absolutely right, i did a dumb thing and i corrected it later after my post here.