franzose/ClosureTable
Adjacency List’ed Closure Table database design pattern implementation for the Laravel framework.
📋 What's Changed
- Column disambiguation in closure table queries (#252) by @franzose in https://github.com/franzose/ClosureTable/pull/284 (originally @Djuuu in https://github.com/franzose/ClosureTable/pull/252)
- Full Changelog: https://github.com/franzose/ClosureTable/compare/v6.2.1...v6.2.2
📋 What's Changed
- feat: add parent_id column to fillable at construct by @penerbangkode in https://github.com/franzose/ClosureTable/pull/257
✨ New Contributors
- @penerbangkode made their first contribution in https://github.com/franzose/ClosureTable/pull/257
- Full Changelog: https://github.com/franzose/ClosureTable/compare/v6.2...v6.2.1
📋 What's Changed
- fix: handle root sibling ordering and add tests by @franzose in https://github.com/franzose/ClosureTable/pull/259
- fix: child positioning by @franzose in https://github.com/franzose/ClosureTable/pull/260
- fix: prevent moving node under its descendant by @franzose in https://github.com/franzose/ClosureTable/pull/261
- fix: honor provided connection in newFromBuilder by @franzose in https://github.com/franzose/ClosureTable/pull/262
- fix: enable soft deletes on base entity by @franzose in https://github.com/franzose/ClosureTable/pull/263
- fix: reorder siblings when moving within same parent by @franzose in https://github.com/franzose/ClosureTable/pull/264
- fix: implement a number of fixes by @franzose in https://github.com/franzose/ClosureTable/pull/265
- Full Changelog: https://github.com/franzose/ClosureTable/compare/v6.1.1...v6.2
Thanks to @devig who pointed this out in #234. This issue has been moved to #238 and fixed by this release.
1. Laravel 8 support in tests, thanks to @avvertix 2. `Entity::parent()` many-to-one relationship to the direct ancestor node 3. Minor tweaks
This is a small release which brings a fix to the regression [pointed out](https://github.com/franzose/ClosureTable/issues/231) by @ritterg.
📦 Improvements
- 1. Fixed a lot of bugs related to positioning and movements between ancestors
- 2. Introduced a bunch of [query scopes](https://github.com/franzose/ClosureTable#scopes) to ease querying. They allowed to simplify the internals too!
- 3. Introduced some [convenient methods](https://github.com/franzose/ClosureTable#collection-methods) to the custom collection in addition to the existing ones
- 3. Fixed bugs in the model and migration generators
- 4. Improved tests and automated Travis CI builds. Many many thanks to @avvertix for the latter!
🗑️ Deprecations
- 3. Entity's `real_depth` attribute & database column have been deprecated and are not included in the generated model and migration anymore
- 4. The following methods of the Entity model has been deprecated and will be removed in the next major release:
- Entity::getRealDepthColumn()
- Entity::getChildrenRelationIndex()
- Entity::getAncestorsTree()
- Entity::getAncestorsWhere()
- Entity::getDescendantsTree()
- Entity::getDescendantsWhere()
- + 4 more
📦 Other notes
- PHP 5.6 support has been dropped. Starting from this release, ClosureTable supports PHP 7.0 and higher.
Fixes and improvements by @dcanaud and @gulch.
Thanks to @dcanaud, the package now supports Laravel 5.5.
Thanks to @krutuzick pull request, the library now supports Laravel 5.4+.
I introduced params binding for raw queries in ClosureTable model.
I have removed checks for ancestor and descendant arguments to be integers because there are situations when one needs to use another column type.
Another Composer dependency fix.
Added support for Laravel 5.2 + other fixes.
Minor fixes by @EspadaV8.
Big big thanks to @EspadaV8 work! Now that his pull request has been accepted we can release a new package version. ClosureTable 4 fully supports Laravel 5 and also follows PSR-2 coding standard. Stay enjoing hierarchical relations!
In this release, I added the third optional argument to `addChild()` and `addSibling()` methods that allows you to get the child or sibling that's being added to an ancestor. Please, explore readme for the examples.
In this release, issues with `removeChild` and `deleteSubtree` methods have been resolved. If you have already been using the package, please set `on delete set null` constraint to the `parent_id` foreign key on your entity table, if that constraint has not been set yet.
Minor fixes.
Many many fixes. Huge thanks to @tomzx for help. Also thanks to all guys who discovered the issues.
Fixed generator that stripped out the first letter of the models. Fixed entity migration stub, made `parent_id` column unsigned to prevent foreign key constraints. Thanks to @kmccarthyweb for the issues.
Finally, I hope that it is, I fixed nodes reordering and moving bugs. Real depth of all descendants of a node now is updated properly when the node is moved somewhere. Also I added guessing of closure table name if its default model class (i.e. `Franzose\ClosureTable\Models\ClosureTable`) is not changed to something else. P.S. Highly recommended for you to update your ClosureTable to this release.
Fixed suddenly arisen issues with reordering siblings.
The new version introduces an injection of the Adjacency List pattern to the pure Closure Table. Adjacency list's features allows to simplify most of the database queries dramatically. In the new version, all the existed bugs were fixed. I also introduced a method, that the community requested long ago. It is called `createFromArray` and is used to create a bunch of records by just passing an array of attributes to it. However, the feature I mentioned is not the only thing I added while developing the 3.0. Explore the source!
Fixed wrong behaviour after `appendChild` with `$returnChild = true`, when retrieving of siblings led to wrong results.
Fixes: 1. #27, database table prefix led to wrong closure table name. 2. #25, wrong behaviour happened while moving a descendant to a new ancestor by using moveTo(). 3. #42, #37, #32, wrong position was set when an entity was moved or created. 4. #43, position was updated even if a user tried to move an entity to the same ancestor it already belonged to.
In this release: 1. Introducing `filteredTree` method, see #18. You can use it when it's necessary to get a tree, filtered by some condition. 2. Fixed #19 (An exception thrown by `\Franzose\ClosureTable\Collection` when tree is empty). 3. Retrieval methods now support selecting certain columns by passing array with their names. _Thanks to @vjandrea for the first two improvements._
Now the package for Laravel 4. It has a lot of improvements over the previous version and still no dependencies on other packages.
