💡 Custom Regulatory Compliance Dashboard See Demo

How to Disable Registration in Filament v4 When Using Custom Auth Pages

| 5 min read
Gerald Warri

Gerald Warri

How to Disable Registration in Filament v4 When Using Custom Auth Pages

You’d think disabling user registration in a Filament panel would be a one-liner.

It’s not — at least not when you’re using discoverPages().

Here’s what’s actually happening behind the scenes and how to fix it.

The Setup

In a Filament v4 panel, you might have a custom Register page that extends Filament’s base class.

class Register extends BaseRegister
{
    protected string $view = 'filament.personal.pages.auth.register';

    // ... customisations
}

And your Panel Provider might look something like this:

return $panel
    ->discoverPages(
        in: app_path('Filament/Personal/Pages'),
        for: 'App\\Filament\\Personal\\Pages'
    );

// Notice: no ->registration() call

You never called ->registration().

So naturally you expect:

/your-panel/register

to return 404.

Instead…

The page loads perfectly.

Why This Happens

The culprit is:

->discoverPages()

When Filament scans your pages directory, it registers every page class it finds.

That includes anything nested under:

Auth/

If Filament encounters a class that extends:

Filament\Auth\Pages\Register

it automatically registers the route during discovery.

This happens regardless of your panel configuration.

The ->registration() method is only for:

• configuring registration

• specifying a custom register class

• explicitly enabling registration

But discoverPages() bypasses that logic entirely.

If the class exists and is discoverable, the route gets registered.

What Doesn’t Work

Attempt 1: Simply not calling ->registration()

// Just don't include ->registration()

Result: The route still exists.

Why?

Because discoverPages() found the class.


Attempt 2: Overriding canAccess()

public static function canAccess(): bool
{
    return false;
}

Still doesn't work

Filament auth pages bypass the canAccess() pipeline.

Login, register, and password reset pages must be accessible before authentication, so Filament intentionally skips the usual access checks.

What Actually Works

Override mount() and redirect.

public function mount(): void
{
    $this->redirect(filament()->getLoginUrl());
}

Why this works:

  • mount() runs before the page renders

  • Livewire processes the redirect immediately

  • The user never sees the registration form

And because you're using Livewire’s redirect helper, everything works cleanly.