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
toeknee2y ago
They are not part of the wizard, they are part of the page
Solution
LeandroFerreira
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
CaptainJoker2y ago
How do we achieve this if being used in the modal of a relationship manager?
LeandroFerreira
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
CaptainJoker2y ago
RelationManager does not have CreateAction
LeandroFerreira
what does it mean? Where is the form?
CaptainJoker
CaptainJoker2y ago
public function form(Form $form): Form { return $form ->schema([ /////// ]); }
LeandroFerreira
ok how do you fire the form/action?
CaptainJoker
CaptainJoker2y ago
ABCRelationManager::class is added in the parent model under the getRelations() function
LeandroFerreira
can you share the ABCRelationManager.php file please?
CaptainJoker
CaptainJoker2y 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
check my example above
CaptainJoker
CaptainJoker2y 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([///////]);

Did you find this page helpful?