F
Filament8mo ago
kian

Create action on custom page

I made a custom page and want to add a 'new' button to it. I added it, when i press it it shows an empty model with only buttons.
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->record(new Page())
];
}
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->record(new Page())
];
}
how can i make it so it opens a modal with fields?
8 Replies
kian
kianOP8mo ago
Is there a way to grab the form that is used in a resource?
Jack
Jack8mo ago
Yes do exactly that^ as long as the models the same
kian
kianOP8mo ago
What are you refering to with 'that'? There is a lot of documentation on those pages hah
Jack
Jack8mo ago
Have you read the documentation?
kian
kianOP8mo ago
Yes I see how I can create a form, but cant find how I can use the CreateAction using the form in my resource
Jack
Jack8mo ago
Didn’t you say it’s a custom page? Is it a resource custom page or separate page?
kian
kianOP8mo ago
A resource custom page I am making a package that will create a custom page on a resource. In there I am sort of recreating the table, but with some extra things. Thats why I want a create button on top Sorry if I'm not clear enough Am just redirecting them to the create page for now. Hopefully there is another way though
Want results from more Discord servers?
Add your server