How can i register plugins dynamically

Hello, i'm working on table where you can enable/disable plugins, is there a way to register plugin to a panel dynamically and load the corresponding pages and resources
8 Replies
Patrick Boivin
Patrick Boivin15mo ago
I think this depends on what's dynamic specifically... where would the configuration for the enabled/disabled plugins come from?
Auceptin
AuceptinOP15mo ago
In a custom package (plugin manager) contains all the informations about enabled/disabled plugins and load namespaces and providers for each plugin, and i want to be able to load the filament resources/pages aswell
Patrick Boivin
Patrick Boivin15mo ago
This plugin manager, would it be itself a plugin? I'm not sure you can disable other plugins from a plugin.
Auceptin
AuceptinOP15mo ago
Is there a way to do it from the main app
Patrick Boivin
Patrick Boivin15mo ago
I'm not sure but I think you could explore making a custom Panel class. Something like this:
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return CustomPanel::make()
// ...
}
}
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return CustomPanel::make()
// ...
}
}
And implement the plugin configuration as part of the custom panel.
Auceptin
AuceptinOP15mo ago
Alright, i'll try this, if l'm not wrong there was a way to do it in v2 using pluginserviceprovider but with v3 i don't if it's still available
Patrick Boivin
Patrick Boivin15mo ago
It's possible... the plugin architecture changed quite a bit in v3
Auceptin
AuceptinOP15mo ago
Yes, thank you
Want results from more Discord servers?
Add your server