Get values of a specific wizard step, which is not active

I am trying to get a value of a step before in my wizard step form, but I can't get it to work. If I dd($get) I can see its there but can't access it. Maybe someone can help
2 Replies
Tieme
Tieme3mo ago
Please share some code with this type of question.
TheNastyPasty
TheNastyPasty3mo ago
Here I am trying to get a value of the step before
foreach ($operatingExpenses as $key => $value) {
if ($value['operating_expenses_type'] === OperatingExpensesType::SetAmount) {
if ($value['period_cost'] === OperatingExpensesAmountPeriod::PerYear) {
$totalMonth += ((float) $value['cost']) / 12;
$totalYear += ((float) $value['cost']);
} elseif ($value['period_cost'] === OperatingExpensesAmountPeriod::PerMonth) {
$totalMonth += ((float) $value['cost']);
$totalYear += ((float) $value['cost']) * 12;
}
} elseif ($value['operating_expenses_type'] === OperatingExpensesType::Percentage) {
dd($get); <--- here
$totalMonth += ((float) $value['percent'] / 100) * $get('purchase_price');
$totalYear += ((float) $value['percent'] / 100) * $get('purchase_price') * 12;
}
}
foreach ($operatingExpenses as $key => $value) {
if ($value['operating_expenses_type'] === OperatingExpensesType::SetAmount) {
if ($value['period_cost'] === OperatingExpensesAmountPeriod::PerYear) {
$totalMonth += ((float) $value['cost']) / 12;
$totalYear += ((float) $value['cost']);
} elseif ($value['period_cost'] === OperatingExpensesAmountPeriod::PerMonth) {
$totalMonth += ((float) $value['cost']);
$totalYear += ((float) $value['cost']) * 12;
}
} elseif ($value['operating_expenses_type'] === OperatingExpensesType::Percentage) {
dd($get); <--- here
$totalMonth += ((float) $value['percent'] / 100) * $get('purchase_price');
$totalYear += ((float) $value['percent'] / 100) * $get('purchase_price') * 12;
}
}
This is what I get
ComponentContainer {#2279}
#model: null
#loadStateFromRelationshipsUsing: null
#saveRelationshipsUsing: null
#saveRelationshipsBeforeChildrenUsing: null
#shouldSaveRelationshipsWhenDisabled: false
#shouldSaveRelationshipsWhenHidden: false
#cachedConcealingComponent: null
#isDisabled: false
#isHidden: false
#isVisible: true
#cachedParentRepeater: null
#columnSpan: array:6 [▶]
#columnStart: array:6 [▶]
#cachedActions: null
#actions: []
#actionFormModel: null
#childComponents: array:6 [▼
0 =>
Filament\Forms\Components
\
TextInput {#3049 …104}
1 =>
Filament\Forms\Components
\
TextInput {#3134 …104}
2 =>
Filament\Forms\Components
\
Repeater {#3073 …112}
3 =>
Filament\Forms\Components
\
Builder {#2715 …103}
4 =>
Filament\Forms\Components
\
Builder {#2670 …103}
5 =>
Filament\Forms\Components
\
TextInput {#2625 …104}
]
ComponentContainer {#2279}
#model: null
#loadStateFromRelationshipsUsing: null
#saveRelationshipsUsing: null
#saveRelationshipsBeforeChildrenUsing: null
#shouldSaveRelationshipsWhenDisabled: false
#shouldSaveRelationshipsWhenHidden: false
#cachedConcealingComponent: null
#isDisabled: false
#isHidden: false
#isVisible: true
#cachedParentRepeater: null
#columnSpan: array:6 [▶]
#columnStart: array:6 [▶]
#cachedActions: null
#actions: []
#actionFormModel: null
#childComponents: array:6 [▼
0 =>
Filament\Forms\Components
\
TextInput {#3049 …104}
1 =>
Filament\Forms\Components
\
TextInput {#3134 …104}
2 =>
Filament\Forms\Components
\
Repeater {#3073 …112}
3 =>
Filament\Forms\Components
\
Builder {#2715 …103}
4 =>
Filament\Forms\Components
\
Builder {#2670 …103}
5 =>
Filament\Forms\Components
\
TextInput {#2625 …104}
]
I need to get the inputs