Lets you sort your Models dynamically by querystring
Simply sort your Models by using querystring parameters., (*1)
composer require marmarait/laraveldynamicsort
, (*2)
php artisan vendor:publish --provider=MarmaraIT\LaravelDynamicSort\DynamicallySortableProvider
, (*3)
Somewhere in the , (*4)
part of your layout add@include('laraveldynamicsort::short_sort')
, (*5)
Backend:, (*6)
To use the jquery-plugin, give the table header(th) elements the attribute data-sort="COLUMNAME" and call the plugin $('.selector').dynamicallySortable() (selector = the th elements; f.e. $('th[data-sort]') ), (*7)
Set the defaultDir property on your model to define the default order direction (asc/desc)
Set the defaultSort property to set the default sorting column, (*8)