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
Matthew16mo ago
you have to go the blade file and write: {{$this->form}}
Yuut4
Yuut416mo 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
neverender24OP16mo ago
<x-filament::page> {{$this->form}} </x-filament::page> I added this no luck
Matthew
Matthew16mo 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
neverender24OP16mo ago
Yes, I need it to be filament
Matthew
Matthew16mo ago
Filament
Getting started - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
Matthew
Matthew16mo 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
Yuut416mo ago
yeah i was thinking the same thing V
Yuut4
Yuut416mo 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
neverender24OP16mo ago
it works
Yuut4
Yuut416mo ago
nice
Matthew
Matthew16mo ago
nice, can you pls mark the soltion for other users to see?
neverender24
neverender24OP16mo ago
the current doc is so confusing it jumps from one to another
Yuut4
Yuut416mo ago
this part prosopem that you already have some experience of livewire etc
neverender24
neverender24OP16mo ago
I'm coming from laravel-inertia page, I think I would learn livewire too
Matthew
Matthew16mo ago
it would be helpful, yes
Yuut4
Yuut416mo ago
It's a good frame to
Matthew
Matthew16mo ago
Im doing that as well
Yuut4
Yuut416mo ago
same
neverender24
neverender24OP16mo 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
Yuut416mo ago
glad we helped xD
Dennis Koch
Dennis Koch16mo ago
There are separate packages and you can use the forms without using the full admin panel. That’s why
Divine
Divine15mo ago
how to do this on v3
Dennis Koch
Dennis Koch15mo ago
Pretty much the same way. Follow the docs and if you are stuck open a thread here
Want results from more Discord servers?
Add your server