© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
6 replies
πTeR

Multiple login models

Hello, how can I use multiple models to diferent logins?
Like
user
user
model and
consumer
consumer
model?

I tried to build diferent panels and set a Login class in a customer panel, like that:

return $panel
          ->id('app')
          ->path('app')
          ->login(**AppLogin::class**)
return $panel
          ->id('app')
          ->path('app')
          ->login(**AppLogin::class**)


So, in
AppLogin
AppLogin
class, I have duplicated all default Login class (
Filament\Pages\Auth\Login.php
Filament\Pages\Auth\Login.php
)

Well.. I think in the method I need to pass something to indicate I´d like to get Consumer models instead User model right?

public function authenticate(): ?LoginResponse
    {
        try {
            $this->rateLimit(5);
        } catch (TooManyRequestsException $exception) {
            // Catch implementation
        }
        $data = $this->form->getState();

        if (! Filament::auth()->attempt($this->getCredentialsFromFormData($data), $data['remember'] ?? false)) {
            throw ValidationException::withMessages([
                'data.email' => __('filament-panels::pages/auth/login.messages.failed'),
            ]);
        }

        session()->regenerate();

        return app(LoginResponse::class);
    }
public function authenticate(): ?LoginResponse
    {
        try {
            $this->rateLimit(5);
        } catch (TooManyRequestsException $exception) {
            // Catch implementation
        }
        $data = $this->form->getState();

        if (! Filament::auth()->attempt($this->getCredentialsFromFormData($data), $data['remember'] ?? false)) {
            throw ValidationException::withMessages([
                'data.email' => __('filament-panels::pages/auth/login.messages.failed'),
            ]);
        }

        session()->regenerate();

        return app(LoginResponse::class);
    }


But I really don´t know what I need to do here..
Someone can help me? Thanks
Solution
Maybe you need to set AuthGuard? https://filamentphp.com/docs/3.x/panels/users#setting-the-authentication-guard
Users - Panel Builder - Filament
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

Customize Login process for multiple panels and "user" models.
FilamentFFilament / ❓┊help
3y ago
Form Wizard multiple models
FilamentFFilament / ❓┊help
2y ago
Import action multiple models
FilamentFFilament / ❓┊help
2y ago
Multiple panel login
FilamentFFilament / ❓┊help
3y ago