Login page parameters

Hello everyone!

I've been struggling with something i'm trying to achieve and would like to ask someone to read my case and give me some advise.

Case
  1. I have created my own 'Team' system and i'm working on team invitations.
  2. Currently, users can receive emails in their inbox with a link to https://xxxx.com/user/login?invitation=xxxxxxxxxxx
  3. The login url/route leads to an extended class of Filament\Pages\Auth\Login which i assigned in the UserPanelProvider in $panel->login(UserLogi::class)
  4. I'm stuck at handling the extra 'invitation' parameter.
  5. I may add/handle more parameters in the future for handling different kind of actions/requests.
My questions
  1. How can access the 'invitation' and possibly other parameters in my UserLogin class?
  2. Since i can't find any other similiar cases. Am i doing this all wrong?
What i tried
In order to understand what i tried, you might wanna check out my code below first.
  1. In my public function form(Form $form) or public function __construct() when i do dd(request('invite') i can see the value of the parameter.
  2. But in my public function beforeAuthenticate() it returns
    null
  3. I've tried to set a parameter in my constructor but it gets set back to null when i'm in my public function authenticate()
My code
class UserLogin extends BaseLogin
{
    public function form(Form $form): Form
    {
        return $form
            ->schema([
                $this->getEmailFormComponent(),
                $this->getPasswordFormComponent(),
                $this->getRememberFormComponent(),
            ])
            ->statePath('data');
    }

    public function authenticate(): ?LoginResponse
    {
        $this->handleTeamInvitation();

        $response = parent::authenticate();

        return $response;
    }

    public function handleTeamInvitation(): void
    {
        
    }
}
Was this page helpful?