main

filamentphp/demo

Last updated at: 29/12/2023 09:41

Login.php

TLDR

This file contains the Login class, which extends the BasePage class from the Filament\Pages\Auth namespace. The mount method is overridden and fills the form with default values.

Methods

mount

The mount method is used to perform initialization logic when the page is mounted. In this class, the mount method is overridden from the parent class. It calls the parent's mount method and then fills the form with default values. The default values include the email address, password, and a flag indicating to remember the user.

Classes

Login

The Login class extends the BasePage class from the Filament\Pages\Auth namespace. It contains a single method, mount, which is used to initialize the page.

<?php

namespace App\Filament\Pages\Auth;

use Filament\Pages\Auth\Login as BasePage;

class Login extends BasePage
{
    public function mount(): void
    {
        parent::mount();

        $this->form->fill([
            'email' => 'admin@filamentphp.com',
            'password' => 'password',
            'remember' => true,
        ]);
    }
}