How to Disable Registration in Filament v4 When Using Custom Auth Pages
Gerald Warri
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() callYou never called ->registration().
So naturally you expect:
/your-panel/registerto 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\Registerit 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 rendersLivewire processes the redirect immediately
The user never sees the registration form
And because you're using Livewire’s redirect helper, everything works cleanly.
Share this article
Related Articles
Build a Modern Admin Dashboard for Your Web Applications
Revamp your web app's admin interface with a sleek, modern dashboard design. Enhance user experience and streamline functionality effortlessly.
Enhancing Filament Tables with Click-to-Edit Columns
Add click-to-edit functionality to Filament tables using Alpine.js and a custom column. Make table edits seamless and intuitive!
Introducing FrontDesk: Your Open-Source Visitor Management System
Streamline visitor check-ins with FrontDesk, an open-source Visitor Management System built with Laravel & Filament PHP.