Skip to content

Commit

Permalink
Allow laravel 5.5 and 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
pionl committed Jun 8, 2018
1 parent d54312c commit e362b60
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pion/laravel-eloquent-position",
"description": "Position logic for Eloquent models with minimum setup",
"require": {
"laravel/framework": "5.1.* || 5.2.* || 5.3.* || 5.4.*"
"laravel/framework": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.*"
},
"require-dev": {
"squizlabs/php_codesniffer": "2.*"
Expand All @@ -20,7 +20,7 @@
"authors": [
{
"name": "Martin Kluska",
"email": "martin.kluska@imakers.cz"
"email": "martin@kluska.cz"
}
],
"minimum-stability": "stable"
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/RecalculatePositionCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Pion\Support\Eloquent\Position\Commands;

use Pion\Support\Eloquent\Position\Traits\PositionTrait;
Expand Down Expand Up @@ -106,7 +107,7 @@ protected function getPositionForGroup($groupKey, &$positionsByGroup)
/**
* Builds the group key from the group columns and the values form the model
*
* @param Model|PositionTrait $model
* @param Model|PositionTrait $model The eloquent model
* @param array $groups
*
* @return string
Expand Down
2 changes: 1 addition & 1 deletion src/PositionObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function saving($model)
// Check if the position is set
if (is_null($position) || $position == '') {
$this->appendLast($model, $oldPosition);
} else if (is_null($oldPosition)) {
} elseif (is_null($oldPosition)) {
$this->forcedPosition($model, $position);
} else {
$this->move($model, $position, $oldPosition);
Expand Down
6 changes: 4 additions & 2 deletions src/Query/PositionQuery.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php

namespace Pion\Support\Eloquent\Position\Query;

use Illuminate\Database\Eloquent\Model;
use Pion\Support\Eloquent\Position\Traits\PositionTrait;

class PositionQuery extends AbstractPositionQuery {
class PositionQuery extends AbstractPositionQuery
{
/**
* @var string
*/
Expand Down Expand Up @@ -84,4 +86,4 @@ public function runQuery($query)

return $this->model()->getPosition();
}
}
}

0 comments on commit e362b60

Please sign in to comment.