Spatie Settings not loading within AdminPanelServiceProvider

Greetings, I've been dynamically loading certain things to let the user customise the panel to their needs, however, after updating the composer it has stopped working. So as an example, I am no longer able to use app(GeneralSettings::class)->name to load something as it has no connection.
7 Replies
Patrick Boivin
What exactly are you trying to control via settings? Can you share the code that was working before the update?
Dionysis
DionysisOP2y ago
Greetings, this is the code I had
No description
Patrick Boivin
I'm not completely sure but I think you can do these steps in bootUsing():
return $panel
// ...
->bootUsing(function ($panel) {
// get settings

$panel->brandName(...);

$panel->favicon(...);
});
return $panel
// ...
->bootUsing(function ($panel) {
// get settings

$panel->brandName(...);

$panel->favicon(...);
});
Dionysis
DionysisOP2y ago
Cheers, that works
Mis Tsu
Mis Tsu16mo ago
I am trying to change panel color with this way and not working the following code ->bootUsing(function ($panel) {
$general_settings = app(GeneralSettings::class); $panel->brandName($general_settings->site_name);
$panel->favicon(asset('storage/'.$general_settings->theme_favicon)); $panel->colors([ 'primary' => $general_settings->theme_color, ]) ; }) Do you have any advice?
Patrick Boivin
Patrick Boivin16mo ago
For the color, I think you can use FilamentColor::register(), here's an example: https://discord.com/channels/883083792112300104/1150491658044051606/1150531056680829049
Mis Tsu
Mis Tsu16mo ago
Thank you, it is working!

Did you find this page helpful?