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