You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this great package. I have just started using it and it is very enjoyable. Unless I overlooked, it seems there are no methods to check if a node is first/last within its level. I think it would be useful for something like disabling "up" and "down" buttons when reordering is needed. In my project I simply adjusted methods up() and down():
/**
* Check if node is first among siblings.
*
* @return bool
*/
public function isFirst()
{
$sibling = $this->prevSiblings()
->defaultOrder('desc')
->first();
return $sibling ? false : true;
}
/**
* Check if node is last among siblings.
*
* @return bool
*/
public function isLast()
{
$sibling = $this->nextSiblings()
->defaultOrder()
->first();
return $sibling ? false : true;
}
Do you think it is worth being added to the package?
The text was updated successfully, but these errors were encountered:
Thank you for this great package. I have just started using it and it is very enjoyable. Unless I overlooked, it seems there are no methods to check if a node is first/last within its level. I think it would be useful for something like disabling "up" and "down" buttons when reordering is needed. In my project I simply adjusted methods
up()
anddown()
:Do you think it is worth being added to the package?
The text was updated successfully, but these errors were encountered: