Kyslik / column-sortable

Package for handling column sorting in Laravel 5/6/7/8
MIT License
644 stars 105 forks source link

Custom path / url in @sortablelink #119

Closed mauro-ni closed 5 years ago

mauro-ni commented 5 years ago

Is there a way to pass custom path / url to @sortablelink?

Use case: a complex page with a paginated & sortable table, with AJAX sorting / browsing.

Solution for pagination: https://laravel.com/docs/5.8/pagination#displaying-pagination-results (section Customizing The Paginator URI)

Thx.

Kyslik commented 5 years ago

Hey @maurosbu only this is supported:

There is a blade extension for you to use @sortablelink()

@sortablelink('column', 'Title', ['parameter' => 'smile'],  ['rel' => 'nofollow'])

Column (1st) parameter is column in database, Title (2nd) parameter is displayed inside anchor tags, array() parameter (3rd) is default (GET) query strings parameter and array() parameter (4th) is for additional anchor-tag attributes.

You can omit 2nd, 3rd and 4th parameter.