Skip to content

Add position manipulation methods

Latest
Compare
Choose a tag to compare
@channor channor released this 20 Mar 11:01

New Features in Version 1.2.0

We've introduced new methods to provide more flexibility in manipulating model positions directly:

  • moveUp(int $by = 1): Increases the model's position level by the specified amount, defaulting to 1. This change is relative to the model's current position, allowing for more intuitive adjustments.

  • moveDown(int $by = 1): Decreases the model's position level by the specified amount, with a default of 1. Similar to moveUp(), this adjustment is made relative to the current position.

  • moveToPosition(int $position): Moves the model to a specified position. The $position argument should be an integer reflecting the desired position. Please note the positioning starts at 1.

These methods are designed to be backward-compatible, ensuring easy integration into existing projects.