Skip to content

Commit 3f13de8

Browse files
committed
📝 Add Acorn usage to the README
1 parent 0dcb57d commit 3f13de8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ $navigation->get()->name;
5757
$navigation->get('name', 'My menu title');
5858
```
5959

60+
### Acorn Usage
61+
62+
If you are using Navi alongside [Acorn](https://roots.io/acorn/) (e.g. Sage), you may generate a usable view component using Acorn's CLI:
63+
64+
```sh
65+
$ acorn make:navi
66+
```
67+
68+
Once generated, you may use the [view component](https://laravel.com/docs/11.x/blade#components) in an existing view like so:
69+
70+
```php
71+
<x-navigation />
72+
```
73+
6074
### Accessing Page Objects
6175

6276
If your menu item is linked to a page object (e.g. not a custom link) – you can retrieve the ID of the page using the `objectId` attribute.

0 commit comments

Comments
 (0)