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.
<x-filament::page>
<form wire:submit.prevent="submit">
{{ $this->form }}
<div class="mt-4">
<x-filament::button type="submit">
Create
</x-filament::button>
</div>
</form>
</x-filament::page>
<x-filament::page>
<form wire:submit.prevent="submit">
{{ $this->form }}
<div class="mt-4">
<x-filament::button type="submit">
Create
</x-filament::button>
</div>
</form>
</x-filament::page>
I currently only know the create button process.
3 Replies
krekas
krekas11mo ago
you need to create actions. see the actions doc section also check how these action are made for resources
ConnorHowell
ConnorHowell11mo ago
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
No description
ConnorHowell
ConnorHowell11mo ago
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