Add create another and cancel buttons in custom form
I created a custom form but I need to know how can i include the create another and cancel buttons in the page, with their respective styling.
I currently only know the create button process.
3 Replies
you need to create actions. see the actions doc section
also check how these action are made for resources
You'd have to make the logic yourself outside of the panel builder.
Create & Create Another links to the same method as Create but with $another set to true, this will just make it not redirect and will just reset the model and call fillForm .
Cancel is just simply a url to either the previous url if available or the index page of the resource in panel builder
Full logic is visible just by looking at the source behind the Panel Builders "CreateRecord" component: https://github.com/filamentphp/filament/blob/3.x/packages/panels/src/Resources/Pages/CreateRecord.php#L210-L247
GitHub
filament/packages/panels/src/Resources/Pages/CreateRecord.php at 3....
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament