Custom Login Page

Sorry for another dumb question, I just am very new to PHP Laravel Development and I found Filament to be really convenient but just need to do a little bit of extra steps. I want to make a custom login page where half of the page is basically an image and the right half is the form this is my code but it doesnt seem to work
<!DOCTYPE html>
<div class="container">
<div class="right-half">
@include('filament.pages.auth.login')
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<div class="container">
<div class="right-half">
@include('filament.pages.auth.login')
</div>
</div>
</body>
</html>
this is the html code placed in Resources > Views > Filamenet > Pages > Auth > login.blade.php and this is my login class
class Login extends \Filament\Pages\Auth\Login
{
protected static string $layout = 'filament.pages.auth.login';

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

protected function getLoginFormComponent(): Component
{
return TextInput::make('login')
->label('Login')
->required()
->autocomplete()
->autofocus();
}
}
class Login extends \Filament\Pages\Auth\Login
{
protected static string $layout = 'filament.pages.auth.login';

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

protected function getLoginFormComponent(): Component
{
return TextInput::make('login')
->label('Login')
->required()
->autocomplete()
->autofocus();
}
}
Solution:
use custome page like this and change the view namespace App\Filament\Pages\Auth;...
Jump to solution
6 Replies
Billi 🌻
Billi 🌻OPβ€’12mo ago
I also tried going to the vendor directory and copy paste the code of the login.blade.php but the <x-filament-panels> errors were showing up, do I have to add them somewhere?
Solution
maheralmatari
maheralmatariβ€’12mo ago
use custome page like this and change the view namespace App\Filament\Pages\Auth; use Filament\Forms\Form; use Filament\Pages\Auth\Login as FilamentLogin; class Login extends FilamentLogin { public static string $view = 'auth.login'; //// here use your view public function form(Form $form): Form { return $form ->schema([
]) ->statePath('data') ->model( ); } } @Billi
Billi 🌻
Billi 🌻OPβ€’12mo ago
But how will the page know where to put the form? Also do I fill out the schema with textInput etc?
Billi 🌻
Billi 🌻OPβ€’12mo ago
Thank youu!! These solutions worked
Shaung Bhone
Shaung Bhoneβ€’12mo ago
okie
Want results from more Discord servers?
Add your server