Skip to content

Commit

Permalink
Merge branch 'master' into L5.4
Browse files Browse the repository at this point in the history
* master:
  Apply CI
  Update license
  Implement Kyslik#52, introduce new configuration key-value pair
  Update travis and readme badge
  Change min-stability to dev and version of testbench
  Change min-stability to dev
  • Loading branch information
Kyslik committed Mar 12, 2017
2 parents 8634238 + 96dc350 commit 1707f8f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
[![Latest Version](https://img.shields.io/github/release/Kyslik/column-sortable.svg?style=flat-square)](https://github.com/Kyslik/column-sortable/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Total Downloads](https://img.shields.io/packagist/dt/Kyslik/column-sortable.svg?style=flat-square)](https://packagist.org/packages/Kyslik/column-sortable)
[![Build Status](https://travis-ci.org/Kyslik/column-sortable.svg?branch=L5.4)](https://travis-ci.org/Kyslik/column-sortable)
[![Build Status](https://travis-ci.org/Kyslik/column-sortable.svg?branch=master)](https://travis-ci.org/Kyslik/column-sortable)

Package for handling column sorting in Laravel 5.[1-4].

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
"Kyslik\\ColumnSortable\\": "src/ColumnSortable/"
}
},
"minimum-stability": "stable"
"minimum-stability": "dev"
}
2 changes: 1 addition & 1 deletion src/ColumnSortable/ColumnSortableServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function boot()
__DIR__ . '/../config/columnsortable.php' => config_path('columnsortable.php')
], 'config');

Blade::directive('sortablelink', function ($expression) {
Blade::directive('sortablelink', function($expression) {
$expression = ($expression[0] === '(') ? substr($expression, 1, -1) : $expression;
return "<?php echo \Kyslik\ColumnSortable\SortableLink::render(array ({$expression}));?>";
});
Expand Down
6 changes: 2 additions & 4 deletions src/ColumnSortable/Sortable.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ private function queryJoinBuilder($query, $relation)
*/
private function columnExists($model, $column)
{
return (isset($model->sortable)) ? in_array($column, $model->sortable) :
Schema::hasColumn($model->getTable(), $column);
return (isset($model->sortable)) ? in_array($column, $model->sortable) : Schema::hasColumn($model->getTable(), $column);
}

/**
Expand All @@ -165,7 +164,6 @@ private function formatToSortParameters($sort)
reset($sort);
$each = each($sort);

return ($each[0] === 0) ? ['sort' => $each[1], 'order' => $configDefaultOrder] :
['sort' => $each[0], 'order' => $each[1]];
return ($each[0] === 0) ? ['sort' => $each[1], 'order' => $configDefaultOrder] : ['sort' => $each[0], 'order' => $each[1]];
}
}

0 comments on commit 1707f8f

Please sign in to comment.