F
Filamentβ€’14mo ago
Scott

Disable "create another" on form (non modal)

I only want to let users create a single item for a model, but in the form it shows "Create and create another". I know you can disable this for a modal Action, but how do you disable it for a regular form?
Solution:
if you are using pages
//CreateXX.php
protected static bool $canCreateAnother = false;
//CreateXX.php
protected static bool $canCreateAnother = false;
...
Jump to solution
5 Replies
Dennis Koch
Dennis Kochβ€’14mo ago
There should be a corresponding method/property on the CreateRecords page
Solution
LeandroFerreira
LeandroFerreiraβ€’14mo ago
if you are using pages
//CreateXX.php
protected static bool $canCreateAnother = false;
//CreateXX.php
protected static bool $canCreateAnother = false;
if you are using modals
Actions\CreateAction::make()
->createAnother(false)
Actions\CreateAction::make()
->createAnother(false)
Dennis Koch
Dennis Kochβ€’14mo ago
And there the property magically appears πŸ˜…
Scott
ScottOPβ€’14mo ago
Nice, thank you!
binaryfire
binaryfireβ€’10mo ago
I don't think this is documented? At least, I couldn't find it..
Want results from more Discord servers?
Add your server