Multiple Panel Resource

is there a way to make a resource, Pages, or widget available to multiple panels ?
10 Replies
awcodes
awcodes10mo ago
You can either change the auto discovery paths or manually register them in the panels that you need them in using ->resources(), ->widgets() and ->pages()
Hussain4real
Hussain4realOP10mo ago
i tried registering them using ->resource() and ->pages() but they don't show up in the navigation of the panel i don't want to auto discover all the resources
awcodes
awcodes10mo ago
Could possibly be a permission issue. I use them to register resources from plugins and it works fine.
$panel->resources([
MediaResource::class,
])
$panel->resources([
MediaResource::class,
])
This works for me
Hussain4real
Hussain4realOP10mo ago
it worked for some resource but some resource it's saying the route is not defined
awcodes
awcodes10mo ago
Might be an issue with the auto discovery. Like if it’s auto discovered it’s creating a route for it under that panel.
Hussain4real
Hussain4realOP10mo ago
let me roll up my sleeves and dig in
awcodes
awcodes10mo ago
Not entirely sure.
Hussain4real
Hussain4realOP10mo ago
thanks for the timeand suggestions The funny thing is among the two resources I included in the $panel->resource([]) One is working on the panel while the other is throwing the route not found error
awcodes
awcodes10mo ago
weird
Hussain4real
Hussain4realOP10mo ago
Not a good way to start the weekend @awcodes found out two things, first the spotlight plugin was the issue for the 'route not found' for a resource, secondly if a resource or page is in a cluster you can't reference it in another panel as a livewire component something like this:
->schema([
Livewire::make(Timetable::class),
])
->schema([
Livewire::make(Timetable::class),
])
the Timetable::class page is under a cluster.
Want results from more Discord servers?
Add your server