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