Position
trait Position
Update position field Change default position attribute in model protected $positionColumnName = 'attribute name';
Methods
static void
bootPosition()
Init model events
string
getPositionAttributeName()
Get position column name
Model
moveFirst()
Move to first position
Model
moveLast()
Move to last position
Model
shiftPosition(Model $target)
Shift position up or down
object
swapPosition(Model $model)
Swap positions
Model
getMaxPosition()
Get model with max position
Details
at line 24
static void
bootPosition()
Init model events
at line 36
protected string
getPositionAttributeName()
Get position column name
at line 63
Model
moveFirst()
Move to first position
at line 85
Model
moveLast()
Move to last position
at line 112
Model
shiftPosition(Model $target)
Shift position up or down
at line 153
object
swapPosition(Model $model)
Swap positions
at line 177
Model
getMaxPosition()
Get model with max position