You are viewing the documentation for an older version of this package. You can check the version you are using with the following command:
composer show spatie/menu
Conditionally Adding Items
v1.1+
The add method has an equivalent method with an if suffix, which takes a condition as it's first argument. The items will only be added to the menu if the condition resolves to true (non-strict).