F
Filamentβ€’17mo ago
maxvankuik

HasBrandName Concern

I came across HasBrandName when I was figuring out how the tenants can manage their 'app_name'. I don't think its documented yet, but I can just call the brandName function on the $panel var right? Like this for example: $panel->brandName(app(GeneralSettings::class)->site_name) Am I doing this right? I thought adding this here is also helpful for people who will search for something alike.
6 Replies
Patrick Boivin
Patrick Boivinβ€’17mo ago
Am I doing this right?
Yeah, looks good πŸ‘
maxvankuik
maxvankuikOPβ€’17mo ago
Hi Patrick thanks for your response. I actually ran into an issue just now. I tried running my migrations on a new machine, but since the PanelProvider acts like Laravel ServiceProvider I believe, the migration couldn't run. I got the error that the settings table does not exist yet. The panel/service provider is already trying to access the Settings table, before any migrations ran. This problem happens only on an empty database, when the database already has the Settings table for example, the migration would run fine. But on a clean database when you try to migrate, it doesn't work. Should we do a check if the table exists? just commenting out isn't really a solution i guess.
Patrick Boivin
Patrick Boivinβ€’17mo ago
Interesting. Maybe you can instead override the getBrandName() method on the Panel class?
leoblanski
leoblanskiβ€’12mo ago
Hey @maxvankuik could you explain how you are populating GeneralSettings? Are you using other provider ? Are you using your application with tenant ?
maxvankuik
maxvankuikOPβ€’12mo ago
Users can populate the data through the admin panel. No other provider I believe. Yes it was supposed to support multiple tenants who can all set their own brand name.
leoblanski
leoblanskiβ€’12mo ago
Just sharing my solution:
No description
Want results from more Discord servers?
Add your server