F
Filament7mo ago
Xerk

Two Table in one resource using wizard

Hello I have a problem with my wizzard I need to create two tables inside one Resource I have two Resource User Resource Profile Resource In my CreateRecord creating steps there so I want to create User first then Profile for this user trying to use handleRecordCreation but actuly I don't know how to use
protected function getSteps(): array
{
return [

Step::make('User Details')
->icon('heroicon-o-user-plus')
->schema([
// Section::make()->schema(),
]),
Step::make('Profile Details')
->icon('heroicon-o-user')
->schema([
Forms\Components\Group::make()
->schema([
Forms\Components\Section::make()
->schema(AgentResource::getFormSchema(['profile']))->columns(2),

Forms\Components\Section::make('Company Details')
->schema(AgentResource::getFormSchema(['company']))
->hidden(fn (Get $get): bool => !$get('is_company'))
->columns(2),

Forms\Components\Section::make('Company Tax Details')
->schema(AgentResource::getFormSchema(['company-tax']))
->hidden(fn (Get $get): bool => !$get('is_company'))
->columns(2),

])
])->columns(3),

];
}
protected function getSteps(): array
{
return [

Step::make('User Details')
->icon('heroicon-o-user-plus')
->schema([
// Section::make()->schema(),
]),
Step::make('Profile Details')
->icon('heroicon-o-user')
->schema([
Forms\Components\Group::make()
->schema([
Forms\Components\Section::make()
->schema(AgentResource::getFormSchema(['profile']))->columns(2),

Forms\Components\Section::make('Company Details')
->schema(AgentResource::getFormSchema(['company']))
->hidden(fn (Get $get): bool => !$get('is_company'))
->columns(2),

Forms\Components\Section::make('Company Tax Details')
->schema(AgentResource::getFormSchema(['company-tax']))
->hidden(fn (Get $get): bool => !$get('is_company'))
->columns(2),

])
])->columns(3),

];
}
0 Replies
No replies yetBe the first to reply to this messageJoin