Closed sahamilton closed 3 months ago
I solved this 'issue' by creating the two functions on the model
public function leftmost(){ return $this->parent()->first()->lft == $this->lft -1; } public function rightmost(){ return $this->parent()->first()->rgt == $this->rgt +1; }
and then test on that in the view
@if (! $page->leftmost() ) do something endif
Is there any method to detect if a node is the left most or right most of a set of siblings? I would like to ensure that a left most node is not moved to the left ( moveLeft() ) or a right most is not moved to the right (moveRight() ) Either case would cause an error