How to create custom page

I follwed this doc https://filamentphp.com/docs/2.x/admin/resources/custom-pages It created a filament custom resource and a view. In the custom page I added class ChangePassword extends Page { protected static string $resource = UserResource::class;
protected static string $view = 'filament.resources.user-resource.pages.change-password'; protected function getActions(): array { return [ Actions\Action::make('save') ]), ]; } public static function form(Form $form): Form { return $form ->schema([ TextInput::make('description') ->maxLength(100)->required(), TextInput::make('denominated') ->maxLength(100) ]); } It just added the action but not the form just like in the image shown, How can I display the form?
Filament
Custom pages - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
No description
24 Replies
Matthew
Matthew2y ago
you have to go the blade file and write: {{$this->form}}
Yuut4
Yuut42y ago
I'm not the best person for this but I'll leave what I think, you can use livewire to listen for events, that is, you add an event in the btn, and in your blade you can create a modal to make a form. it seems easier
neverender24
neverender24OP2y ago
<x-filament::page> {{$this->form}} </x-filament::page> I added this no luck
Matthew
Matthew2y ago
ah I see, the issue is that when you create a Page, its a livewire component the form function you added is for filament only
neverender24
neverender24OP2y ago
Yes, I need it to be filament
Matthew
Matthew2y ago
Filament
Getting started - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
Matthew
Matthew2y ago
protected function getFormSchema(): array
{
return [
Forms\Components\TextInput::make('title')->required(),
Forms\Components\MarkdownEditor::make('content'),
// ...
];
}
protected function getFormSchema(): array
{
return [
Forms\Components\TextInput::make('title')->required(),
Forms\Components\MarkdownEditor::make('content'),
// ...
];
}
Yuut4
Yuut42y ago
yeah i was thinking the same thing V
Yuut4
Yuut42y ago
GitHub
Use form builder inside custom page (Filament Admin) · filamentphp ...
Hello again! I'm new to Livewire and Filament. I'm building a custom page for my site settings for admins. I'm a little bit lost on how do I leverage the custom form builder and spit it...
neverender24
neverender24OP2y ago
it works
Yuut4
Yuut42y ago
nice
Matthew
Matthew2y ago
nice, can you pls mark the soltion for other users to see?
neverender24
neverender24OP2y ago
the current doc is so confusing it jumps from one to another
Yuut4
Yuut42y ago
this part prosopem that you already have some experience of livewire etc
neverender24
neverender24OP2y ago
I'm coming from laravel-inertia page, I think I would learn livewire too
Matthew
Matthew2y ago
it would be helpful, yes
Yuut4
Yuut42y ago
It's a good frame to
Matthew
Matthew2y ago
Im doing that as well
Yuut4
Yuut42y ago
same
neverender24
neverender24OP2y ago
It's good actually, I have this filament hype for fast projects. And new developer can easily make this rather for simple project without learning vue-inertia thanks guys
Yuut4
Yuut42y ago
glad we helped xD
Dennis Koch
Dennis Koch2y ago
There are separate packages and you can use the forms without using the full admin panel. That’s why
Divine
Divine17mo ago
how to do this on v3
Dennis Koch
Dennis Koch17mo ago
Pretty much the same way. Follow the docs and if you are stuck open a thread here

Did you find this page helpful?