This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables users to build and register custom pages within the Nebula panel.
It introduces a new
php artisan nebula:page
command that will generate a new class inapp/Nebula/Pages
, as well as a view underresources/views/nebula/pages
.To register a new page, you follow the same pattern as the dashboards and resources, adding
new PageClass
under thenebula.pages
configuration option.The idea for these pages is similar to Laravel Nova's custom tools. Have a uniform API that allows developers to build third-party extensions for Nebula.
I've named them pages because using the term Tool felt too similar to Nova, but I'm happy to change this.
It's also worth noting that the developer doesn't need to use the
nebula::layouts.shell
view in their pages view, since it will automatically be wrapped in it. Instead, they only need to worry about what their page will display.The page also moves away from the
singularName()
andpluralName()
pattern that the resources & dashboards follow because it didn't make much sense here. Instead theNebulaPage::name()
method will be used for displaying the menu item and the page title.For the URL slug / route binding, a new
NebulaPage::slug()
method has been introduced which will be used to match the page.Happy to hear thoughts and ideas on this - this was the simplest implementation after all. 馃