F
Filamentβ€’13mo ago
ngoquocdat

Form in page

Hi guys, I'm making a user profile that using custom Page and form aside layout. Current it doesnt have form and button to submit. I want to inject to button at the bottom of the form. Here is my code
class Profile extends Page
{
...

public function updateProfileForm(Form $form): Form
{
return $form->schema([
Group::make()
->id('personalInformation')
->extraAttributes([
'class' => 'p-16 max-w-5xl',
])
->schema([
Section::make(__('Personal Information'))
->description(__('Manage your personal information'))
->aside()
->schema([
TextInput::make('name')
->required(),
TextInput::make('email')
->required()
->email()
->unique(ignoreRecord: true),
]),
]),
])
->statePath('userDate');
}

...
}
class Profile extends Page
{
...

public function updateProfileForm(Form $form): Form
{
return $form->schema([
Group::make()
->id('personalInformation')
->extraAttributes([
'class' => 'p-16 max-w-5xl',
])
->schema([
Section::make(__('Personal Information'))
->description(__('Manage your personal information'))
->aside()
->schema([
TextInput::make('name')
->required(),
TextInput::make('email')
->required()
->email()
->unique(ignoreRecord: true),
]),
]),
])
->statePath('userDate');
}

...
}
<x-filament::page>
{{ $this->updateProfileForm }}

{{ $this->changePasswordForm }}
</x-filament::page>
<x-filament::page>
{{ $this->updateProfileForm }}

{{ $this->changePasswordForm }}
</x-filament::page>
8 Replies
ngoquocdat
ngoquocdatβ€’13mo ago
here is what i want
Dennis Koch
Dennis Kochβ€’13mo ago
Don't use a group inside the from but in your Blade view instead.
ngoquocdat
ngoquocdatβ€’13mo ago
thanks for reply me. but how to use group in blade view, is there mentioned in the docs?
Dennis Koch
Dennis Kochβ€’13mo ago
I bet there is a card component. No blade components are not documented. Check the source code
ngoquocdat
ngoquocdatβ€’13mo ago
ok, thx i will check
ngoquocdat
ngoquocdatβ€’13mo ago
found it
Dennis Koch
Dennis Kochβ€’13mo ago
That's not what I meant, but if it works πŸ€·πŸΌβ€β™‚οΈ
ngoquocdat
ngoquocdatβ€’13mo ago
okay, hh. btw, thank you