© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3mo ago•
3 replies
mmoollllee

Panel with ->domains option

I'm trying to make my Panel work for two specific domains using the ->domains() option. With php artisan optimize I get
 The current domain is not set, but multiple domains are registered for the panel. Please use [Filament::currentDomain('example.com')] to set the current domain to ensure that panel URLs are generated correctly.
 The current domain is not set, but multiple domains are registered for the panel. Please use [Filament::currentDomain('example.com')] to set the current domain to ensure that panel URLs are generated correctly.


I've tried defining Filament::currentDomain('example.com') in various places but it didn't work out.
Can someone help me out?
Solution
Okay I think I found a workaround with:

class GlobalPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        $domains = ['maindomain.com', 'otherdomain.com'];

        if (app()->runningInConsole() && ! empty($domains)) {
            Filament::currentDomain($domains[0]);
        }

        return $panel
            ->default()
            ->id('global')
            ->path('/')
            ->domains($domains)
class GlobalPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        $domains = ['maindomain.com', 'otherdomain.com'];

        if (app()->runningInConsole() && ! empty($domains)) {
            Filament::currentDomain($domains[0]);
        }

        return $panel
            ->default()
            ->id('global')
            ->path('/')
            ->domains($domains)
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Panel domains not working on v4
FilamentFFilament / ❓┊help
8mo ago
use same panel on mulitple domains
FilamentFFilament / ❓┊help
3y ago
Access 1 Filament panel via multiple domains
FilamentFFilament / ❓┊help
3y ago
Remove "all" option from pagination for entire panel
FilamentFFilament / ❓┊help
3y ago