Closed kmaphane closed 2 months ago
Okay figured it out. Sorry.
public function markerAction(): Action { return Action::make('markerAction') ->label('Water meter details') ->infolist(function (array $arguments) { $modelId = array_key_exists('model_id', $arguments) ? $arguments['model_id'] : null;
return [
Section::make([
Livewire::make(DynamicWaterOverview::class, ['modelId' => $modelId]),
]),
Section::make([
Livewire::make(WaterMeterOverview::class),
]),
Section::make([
Livewire::make(AllHourlyConsumption::class),
]),
];
})
->record(function (array $arguments) {
return array_key_exists('model_id', $arguments) ? WaterMeter::find($arguments['model_id']) : null;
})
->modalWidth('5xl')
->modalSubmitAction(false);
}
Good day,
I am trying to do the following:
public function markerAction(): Action { return Action::make('markerAction') ->label('Water meter details') ->infolist([ Section::make([ Livewire::make(DynamicWaterOverview::class, ['model_id' => $this->model_id]), ]), Section::make([ Livewire::make(WaterMeterOverview::class), ]), Section::make([ Livewire::make(AllHourlyConsumption::class), ]), ]) ->record(function (array $arguments) { if (array_key_exists('model_id', $arguments)) { $this->model_id = $arguments['model_id']; }
My modelId is always null when in the receiving livewire component. Any help I can get will be appreciated.