diff --git a/CHANGELOG.md b/CHANGELOG.md
index 31c75f32..277b1db7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,13 @@
+## 1.0.15
+_Mar 4 2015_
+* bug fixes
+ - Backport minor bugfixes from master.
+
+## 1.0.14
+_Mar 3 2015_
+* bug fixes
+ - Backwards compatible version for Laravel 4.2.x.
+
## 1.0.13
_Sep 30 2014_
* bug fixes
diff --git a/README.md b/README.md
index 361bf08b..4b42b916 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,9 @@
[![Build Status](https://travis-ci.org/etrepat/baum.png?branch=master)](https://travis-ci.org/etrepat/baum)
-Baum is an implementation of the [Nested Set](http://en.wikipedia.org/wiki/Nested_set_model)
-pattern for [Laravel 4's](http://laravel.com/) Eloquent ORM.
+Baum is an implementation of the [Nested Set](http://en.wikipedia.org/wiki/Nested_set_model) pattern for [Laravel 4's](http://laravel.com/) Eloquent ORM.
+
+> For **Laravel 5.x compatibility**, check the [master](https://github.com/etrepat/baum/tree/master) branch or use the latest [1.1.x tagged release](https://github.com/etrepat/baum/releases).
## Documentation
@@ -93,7 +94,7 @@ ordinary trees are suddenly quite fast. Nifty, isn't it?
## Installation
-Baum works with Laravel 4 onwards. You can add it to your `composer.json` file
+Baum works with Laravel 4.2 onwards. You can add it to your `composer.json` file
with:
"baum/baum": "~1.0"
@@ -331,7 +332,7 @@ You can ask some questions to your Baum nodes:
* `isAncestorOf($other)`: Returns true if node is an ancestor of the other.
* `isSelfOrAncestorOf($other)`: Returns true if node is self or an ancestor.
* `equals($node)`: current node instance equals the other.
-* `insideSubtree($node)`: Checks wether the given node is inside the subtree
+* `insideSubtree($node)`: Checks whether the given node is inside the subtree
defined by the left and right indices.
* `inSameScope($node)`: Returns true if the given node is in the same scope
as the current one. That is, if *every* column in the `scoped` property has
@@ -474,7 +475,7 @@ Retrieving a complete tree hierarchy into a regular `Collection` object with
its children *properly nested* is as simple as:
```php
-$tree = Category::where('name', '=', Books)->first()->getDescendantsAndSelf()->toHierarchy();
+$tree = Category::where('name', '=', 'Books')->first()->getDescendantsAndSelf()->toHierarchy();
```
diff --git a/composer.json b/composer.json
index 537ed7ff..a0fd8bfd 100644
--- a/composer.json
+++ b/composer.json
@@ -13,10 +13,10 @@
],
"require": {
"php": ">=5.3.0",
- "illuminate/support": "4.*|5.*",
- "illuminate/console": "4.*|5.*",
- "illuminate/filesystem": "4.*|5.*",
- "illuminate/database": "4.*|5.*"
+ "illuminate/support": "4.*",
+ "illuminate/console": "4.*",
+ "illuminate/filesystem": "4.*",
+ "illuminate/database": "4.*"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
diff --git a/src/Baum/BaumServiceProvider.php b/src/Baum/BaumServiceProvider.php
index 1f74ee54..d6ec960f 100644
--- a/src/Baum/BaumServiceProvider.php
+++ b/src/Baum/BaumServiceProvider.php
@@ -14,7 +14,7 @@ class BaumServiceProvider extends ServiceProvider {
*
* @var string
*/
- const VERSION = '1.0.13';
+ const VERSION = '1.0.15';
/**
* Indicates if loading of the provider is deferred.
diff --git a/src/Baum/Node.php b/src/Baum/Node.php
index 1d250524..8dcab130 100644
--- a/src/Baum/Node.php
+++ b/src/Baum/Node.php
@@ -500,8 +500,9 @@ public function scopeWithoutRoot($query) {
public function scopeLimitDepth($query, $limit) {
$depth = $this->exists ? $this->getDepth() : $this->getLevel();
$max = $depth + $limit;
+ $scopes = array($depth, $max);
- return $query->whereBetween($this->getDepthColumnName(), array($depth, $max));
+ return $query->whereBetween($this->getDepthColumnName(), array(min($scopes), max($scopes)));
}
/**
diff --git a/src/Baum/SetValidator.php b/src/Baum/SetValidator.php
index 14002290..10d87640 100644
--- a/src/Baum/SetValidator.php
+++ b/src/Baum/SetValidator.php
@@ -71,7 +71,7 @@ protected function validateBounds() {
$qualifiedRgtCol >= parent.$rgtCol)))";
$query = $this->node->newQuery()
- ->join($connection->raw($grammar->wrap($tableName).' AS parent'),
+ ->join($connection->raw($grammar->wrapTable($tableName).' AS parent'),
$parentColumn, '=', $connection->raw('parent.'.$grammar->wrap($primaryKeyName)),
'left outer')
->whereRaw($whereStm);
diff --git a/tests/suite/QueryBuilderExtensionTest.php b/tests/suite/QueryBuilderExtensionTest.php
index 1acfa64c..0433493f 100644
--- a/tests/suite/QueryBuilderExtensionTest.php
+++ b/tests/suite/QueryBuilderExtensionTest.php
@@ -32,7 +32,7 @@ public function testAggregatesRemoveOrderBy() {
$this->assertEquals(1, $results);
$builder = $this->getBuilder();
- $builder->getConnection()->shouldReceive('select')->once()->with('select count(*) as aggregate from "users"', array())->andReturn(array(array('aggregate' => 1)));
+ $builder->getConnection()->shouldReceive('select')->once()->with('select count(*) as aggregate from "users" limit 1', array())->andReturn(array(array('aggregate' => 1)));
$builder->getProcessor()->shouldReceive('processSelect')->once()->andReturnUsing(function($builder, $results) { return $results; });
$results = $builder->from('users')->orderBy('age', 'desc')->exists();
$this->assertTrue($results);