Attributes to pass to add function in Navigation.php #15
-
Hi! I'm trying to set the I can do it without any problems when the item is a subitem from a menu however. Thanks! Fernando P. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
According to the merged code the author only added the attributes parameter to the Section class and not the Navigation class (possibly forgotten). So the example that was given does not work. I guess for now you can pass a callback which adds the the attributes Navigation::make()->add('Home', route('admin.home'), fn($s) => $s->attributes(['icon' => 'fa-solid fa-house'])) Maybe add macro support to the Navigation/Section class would be nice. But since this package is framework agnostic its not as simple as adding a trait from Laravel. Edit: oh wait im dumb, its in the name. Just doesn't have the requirements in the composer.json. |
Beta Was this translation helpful? Give feedback.
According to the merged code the author only added the attributes parameter to the Section class and not the Navigation class (possibly forgotten). So the example that was given does not work.
I guess for now you can pass a callback which adds the the attributes
Maybe add macro support to the Navigation/Section class would be nice. But since this package is framework agnostic its not as simple as adding a trait from Laravel.
Edit: oh wait im dumb, its in the name. Just doesn't have the requirements in the composer.json.