//custom pagepublic function loadChart($form){ $this->emit('refreshChart', $form); $this->emit('refreshComponent');}//chartprotected $listeners = ['refreshChart' => 'refreshChart' , 'refreshComponent' => '$refresh'];public function refreshChart($form_selected){ $this->form_selected = $form_selected;}
Grid::make(1) ->schema([ Repeater::make('metrics') ->id('metrics') ->schema([ Repeater::make('variation_input_targets') ->id('variation_input_targets') ->schema([ Forms\Components\Select::make('form_id') ->relationship('form', 'name') ->reactive() ->required(), Select::make('type_metric') ->required() ->options(function (callable $get) { $form = ModelsForm::find($get('form_id')); if($form){ $result = array_column($form->inputs, 'title', 'id'); return $result; } })->reactive(), ]), ]), ]),
Forms\Components\Select::make('form_id') ->relationship('form', 'name') ->required(),Grid::make(1) ->schema([ Repeater::make('metrics') ->id('metrics') ->schema([ Repeater::make('variation_input_targets') ->id('variation_input_targets') ->schema([ Select::make('type_metric') ->required() ->options(function (callable $get) { $form = ModelsForm::find($get('form_id')); if($form){ return $form->inputs->pluck('title', 'id'); } })->reactive(), ]), ]), ]),