laravel-navigation icon indicating copy to clipboard operation
laravel-navigation copied to clipboard

feat: support rendering the current section

Open innocenzi opened this issue 2 years ago • 1 comments

When using this package with Inertia, I often need the current section to display data related to the current page. Unfortunately, this is quite hard to achieve - I need to create a custom renderer in my application code.

This PR solves that problem by adding a new SectionRenderer and a current method on Navigation, in order to render the section that is currently active.

Additionally, I updated the docs to add an example of this feature, and updated the previous examples to use Navigation::make() instead of app(Navigation::class).

innocenzi avatar Jul 11 '22 10:07 innocenzi

Could you take a look at this @sebastiandedeyne ?

freekmurze avatar Jul 13 '22 21:07 freekmurze

Sorry to bother - may I kindly ask for this PR to be reviewed/merged? 😊

innocenzi avatar Oct 17 '22 00:10 innocenzi

Looks good, thanks!

sebastiandedeyne avatar Oct 18 '22 06:10 sebastiandedeyne