Skip to content

Attributes to pass to add function in Navigation.php #15

Answered by ivalkenburg
fefo-p asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fefo-p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants