Skip to content

Commit

Permalink
📝 Add Acorn usage to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Mar 26, 2024
1 parent 0dcb57d commit 3f13de8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ $navigation->get()->name;
$navigation->get('name', 'My menu title');
```

### Acorn Usage

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:

```sh
$ acorn make:navi
```

Once generated, you may use the [view component](https://laravel.com/docs/11.x/blade#components) in an existing view like so:

```php
<x-navigation />
```

### Accessing Page Objects

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.
Expand Down

0 comments on commit 3f13de8

Please sign in to comment.