How to Use Sortable in Laravel to Sort columns? 1


How-to-use-Sortable-in-Laravel-to-sort-columns

 

Solution :

 

The Kyslik-ColumnSortable package can be used to sort the columns of view files in Larvel.

Step 1:

Install the package for Kyslik-ColumnSortable by the following command:

 

composer require kyslik/column-sortable

Step 2:

Now you can check your composer.json file, that "kyslik/column-sortable": "^6.4" is included under require array. Version may vary. It will look like this:

 

 

"require": {

"kyslik/column-sortable": "^6.0"

      }

 

Step 3:

Open the config/app.php if you are installing it for the first time else you can jump to Step 5.

Step 4:

Add the following line in providers array.

 

Kyslik\ColumnSortable\ColumnSortableServiceProvider::class,

 

 

It should look like this:

 

'providers' => [

App\Providers\RouteServiceProvider::class, /* * Third Party Service Providers... */

Kyslik\ColumnSortable\ColumnSortableServiceProvider::class,

],