2017 © Pedro Peláez
 

library laravel-table-sorter

Laravel table sorter

image

am2studio/laravel-table-sorter

Laravel table sorter

  • Monday, November 20, 2017
  • by msamec
  • Repository
  • 6 Watchers
  • 1 Stars
  • 3,416 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 15 Versions
  • 2 % Grown

The README.md

Laravel-TableSorter

Package contains helper function for creating sortable colums in table, (*1)

Install

Via Composer, (*2)

``` bash $ composer require am2studio/laravel-table-sorter, (*3)


## Usage Code in view : ```php {{ \AM2Studio\Laravel\TableSorter\TableSorter::sort( [ ['name' => 'first_name', 'title' => trans('ui.user.first_name')], ['name' => 'last_name', 'title' => trans('ui.user.last_name')], ['name' => 'gender', 'title' => trans('ui.user.gender')], ], $users, [ 'sort_by' => 'name', 'sort_type' => 'ASC', 'template' => '<th class="%s"><a href="%s">%s</a></th>' ]) }}

variable $headings contains name and title for table columns, example for users, (*4)

[
  ['name' => 'first_name', 'title' => trans('ui.user.first_name')],
  ['name' => 'last_name',  'title' => trans('ui.user.last_name')],
  ['name' => 'gender',     'title' => trans('ui.user.gender')],
]

variable $config contains default sort_by/sort_type and template, (*5)

[
    'sort_by' => 'name', 'sort_type' => 'ASC',
    'template' => '<th class="%s"><a href="%s">%s</a></th>'
]

Controller code:, (*6)

public function index()
{
    $users = (new User)->paginate(10);
    return $this->view('index', compact('users'));
}

Full view table :, (*7)



{{ \AM2Studio\Laravel\TableSorter\TableSorter::sort( [ ['name' => 'first_name', 'title' => trans('ui.user.first_name')], ['name' => 'last_name', 'title' => trans('ui.user.last_name')], ['name' => 'gender', 'title' => trans('ui.user.gender')], ], $users, [ 'sort_by' => 'name', 'sort_type' => 'ASC', 'template' => '' ]) }} @foreach($users as $user) @endforeach
%s
{{ $user->first_name }} {{ $user->last_name }} {{ $user->gender }}
{!! $users !!}

Change log

Please see CHANGELOG for more information what has changed recently., (*8)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*9)

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions

20/11 2017

dev-master-2

dev-master-2 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

02/05 2017

2.2.5

2.2.5.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

28/04 2017

2.2.4

2.2.4.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

09/02 2017

dev-master

9999999-dev https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

09/02 2017

3.0

3.0.0.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

22/06 2016

2.2.3

2.2.3.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

27/04 2016

2.2.2

2.2.2.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

26/04 2016

2.1.1

2.1.1.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

22/04 2016

2.0.0

2.0.0.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

22/04 2016

2.1.0

2.1.0.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

18/04 2016

1.0.6

1.0.6.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

18/04 2016

1.0.5

1.0.5.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

16/02 2016

1.0.4

1.0.4.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

16/02 2016

1.0.2

1.0.2.0 https://github.com/AM2studio/Laravel-TableSorter

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter

16/02 2016

1.0.0

1.0.0.0 https://github.com/AM2studio/Laravel-Finite

Laravel table sorter

  Sources   Download

MIT

The Requires

 

am2studio laravel table sorter