FilamentF
Filament14mo ago
B2

The POST method is not supported for route admin/login for custom login page

Hello,

I have an issue with a custom login page in Laravel 11 with Filament 3. When I submit the form, I get the error:
"The POST method is not supported for route admin/login. Supported methods: GET, HEAD."

Here’s my setup:

Custom Login Class
class Login extends BaseAuth
{
    protected static ?string $navigationIcon = 'heroicon-o-document-text';
    protected static string $view = 'filament.pages.auth.login';
    protected static string $layout = 'filament.layouts.layout-login';

    public function form(Form $form): Form
    {
        return $form
            ->schema([
                $this->getEmailFormComponent(),
                $this->getPasswordFormComponent(),
                $this->getRememberFormComponent(),
            ])
            ->statePath('data');
    }
}

Added to AdminPanelProvider
public function panel(Panel $panel): Panel
{
    return $panel
        ->login(Login::class);
}

Custom Template
<x-filament-panels::page.simple>
    <x-filament-panels::form id="form" wire:submit="authenticate">
        {{ $this->form }}
        <x-filament-panels::form.actions :actions="$this->getCachedFormActions()" />
    </x-filament-panels::form>
</x-filament-panels::page.simple>

Despite this, the error persists. Is there something I missed in the configuration?

Thanks for your help!
Was this page helpful?