How to remove create / create another buttons from wizard?

Solution:
if you are using wizard in resources, you should use HasWizard trait and getSteps() method in the CreatePage https://filamentphp.com/docs/3.x/panels/resources/creating-records#using-a-wizard...
Jump to solution
14 Replies
toeknee
toeknee11mo ago
They are not part of the wizard, they are part of the page
Solution
LeandroFerreira
LeandroFerreira11mo ago
if you are using wizard in resources, you should use HasWizard trait and getSteps() method in the CreatePage https://filamentphp.com/docs/3.x/panels/resources/creating-records#using-a-wizard
CaptainJoker
CaptainJoker11mo ago
How do we achieve this if being used in the modal of a relationship manager?
LeandroFerreira
LeandroFerreira11mo ago
https://filamentphp.com/docs/3.x/actions/modals#using-a-wizard-as-a-modal-form
Tables\Actions\CreateAction::make()
->steps([
Step::make('step1')
->schema([...]),
Step::make('step2')
->schema([...]),
])
Tables\Actions\CreateAction::make()
->steps([
Step::make('step1')
->schema([...]),
Step::make('step2')
->schema([...]),
])
CaptainJoker
CaptainJoker11mo ago
RelationManager does not have CreateAction
LeandroFerreira
LeandroFerreira11mo ago
what does it mean? Where is the form?
CaptainJoker
CaptainJoker11mo ago
public function form(Form $form): Form { return $form ->schema([ /////// ]); }
LeandroFerreira
LeandroFerreira11mo ago
ok how do you fire the form/action?
CaptainJoker
CaptainJoker11mo ago
ABCRelationManager::class is added in the parent model under the getRelations() function
LeandroFerreira
LeandroFerreira11mo ago
can you share the ABCRelationManager.php file please?
CaptainJoker
CaptainJoker11mo ago
It has around 800+ lines, but I checked in the file it has in the header action, can anything be done here? ->headerActions([ Tables\Actions\CreateAction::make(), ])
LeandroFerreira
LeandroFerreira11mo ago
check my example above
CaptainJoker
CaptainJoker11mo ago
Thank you so very much @Leandro Ferreira, I was able to achieve what was needed by shifting the code from form() function to CreateAction::make()->steps([///////]);
Want results from more Discord servers?
Add your server
More Posts