Methods |
public
static
|
bootOrderable()
Adds position to model on creating event.
Adds position to model on creating event.
|
#
|
public
|
newCollection(array $models = [])
|
#
|
public
|
getOrderColumn(): string
|
#
|
public
|
getPosition()
|
#
|
public
|
getMaxPosition(): int
Returns the maximum possible position for the current model.
Returns the maximum possible position for the current model.
|
#
|
public
|
getNextPosition(): int
Returns the position for a newly inserted model.
Returns the position for a newly inserted model.
|
#
|
public
|
scopeOrdered(Builder $query, string $direction = 'asc'): void
|
#
|
public
|
scopeUnordered(Builder $query): void
|
#
|
public
|
scopeForceOrderBy(Builder $query, mixed $column, string $direction = 'asc'): void
|
#
|
public
|
moveToOffset(int $newOffset)
|
#
|
public
|
moveToStart(): $this
Moves the current model to the first position.
Moves the current model to the first position.
|
#
|
public
|
moveToEnd()
moves $this model to the last position.
moves $this model to the last position.
|
#
|
public
|
moveToPosition(int $newPosition)
|
#
|
public
|
moveUp(int $positions = 1, boolean $strict = true)
|
#
|
public
|
moveDown(int $positions = 1, boolean $strict = true)
|
#
|
public
|
swapWith(static $entity)
|
#
|
public
|
moveAfter(static $entity)
moves $this model after $entity model (and rearrange all entities).
moves $this model after $entity model (and rearrange all entities).
Throws
|
#
|
public
|
moveBefore(static $entity)
moves $this model before $entity model (and rearrange all entities).
moves $this model before $entity model (and rearrange all entities).
Throws
|
#
|
protected
|
move(string $action, static $entity)
Parameters
$action |
moveAfter/moveBefore
|
Throws
|
#
|
protected
|
getNewPosition(bool $isMoveBefore, bool $isMoveForward, $position): mixed
|
#
|
protected
|
newQueryBetween($leftPosition, $rightPosition): Builder
|
#
|
public
|
previous(int $limit = null): Builder
|
#
|
public
|
next(int $limit = null): Builder
|
#
|
public
|
scopeSetOrder(Builder $query, array $ids): int
Reorders the elements based on their ids.
Reorders the elements based on their ids.
|
#
|