diff --git a/README.md b/README.md index b9d6028..0b24973 100755 --- a/README.md +++ b/README.md @@ -99,14 +99,18 @@ Sortable trait adds Sortable scope to the models so you can use it with paginate ## Blade Extension -There is one blade extension for you to use +There is one blade extension for you to use **@sortablelink** + ``` @sortablelink('column', 'Title') +@sortablelink('name') ``` **Column** (1st) parameter is `order by` and **Title** (2nd) parameter is displayed inside anchor tags. You can omit **Title** parameter. +>**WARNING**: @sortablelink directive only accepts single quotes + ## Config in few words Sortablelink blade extension distinguishes between "types" (numeric, amount and alpha) and applies different class for each of them. See following snippet: diff --git a/composer.json b/composer.json index cb9d2cc..6a9ebde 100755 --- a/composer.json +++ b/composer.json @@ -18,8 +18,8 @@ ], "require": { "php": ">=5.6.4", - "Illuminate/Support": "^5.0", - "Illuminate/Database": "^5.0" + "Illuminate/Support": "5.1.* || 5.2.* || 5.3.*", + "Illuminate/Database": "5.1.* || 5.2.* || 5.3.*" }, "require-dev": { "phpunit/phpunit": "~5.0", diff --git a/src/ColumnSortable/ColumnSortableServiceProvider.php b/src/ColumnSortable/ColumnSortableServiceProvider.php index 694557d..4ee8985 100755 --- a/src/ColumnSortable/ColumnSortableServiceProvider.php +++ b/src/ColumnSortable/ColumnSortableServiceProvider.php @@ -30,8 +30,9 @@ public function boot() ], 'config'); Blade::directive('sortablelink', function ($expression) { + //TODO: only accepts single quotes 'Email', would be nice to accept double quotes as well. $expression = ($expression[0] === '(') ? substr($expression, 1, -1) : $expression; - return ""; + return ""; }); } diff --git a/src/ColumnSortable/Sortable.php b/src/ColumnSortable/Sortable.php index 78b442c..3cfeba0 100755 --- a/src/ColumnSortable/Sortable.php +++ b/src/ColumnSortable/Sortable.php @@ -48,7 +48,6 @@ public function scopeSortable($query, $default = null) private function queryOrderBuilder($query, array $sortArray) { $model = $this; - //dd($model); $direction = array_get($sortArray, 'order', 'asc'); if (!in_array($direction, ['asc', 'desc'])) {