Omar
Omar
FFilament
Created by Omar on 1/8/2024 in #❓┊help
Set default value to a select, listening the change from another input
It works, thank you very much for the information
7 replies
FFilament
Created by Omar on 10/30/2023 in #❓┊help
FormBuilder Select get event Editing
I need to obtain as the event when a resource is being edited or created, since the return of the options would be different
5 replies
FFilament
Created by Omar on 9/2/2023 in #❓┊help
How can I refresh a widget so that the variable that I send to it is updated?
//custom page
public function loadChart($form){
$this->emit('refreshChart', $form);
$this->emit('refreshComponent');
}

//chart
protected $listeners = ['refreshChart' => 'refreshChart' , 'refreshComponent' => '$refresh'];
public function refreshChart($form_selected)
{
$this->form_selected = $form_selected;
}
//custom page
public function loadChart($form){
$this->emit('refreshChart', $form);
$this->emit('refreshComponent');
}

//chart
protected $listeners = ['refreshChart' => 'refreshChart' , 'refreshComponent' => '$refresh'];
public function refreshChart($form_selected)
{
$this->form_selected = $form_selected;
}
this worked for me
5 replies
FFilament
Created by Omar on 9/2/2023 in #❓┊help
How can I refresh a widget so that the variable that I send to it is updated?
on v2
5 replies
FFilament
Created by Omar on 8/29/2023 in #❓┊help
How could I add the options to a Select, when the options are inside the relationship in a json colu
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(),
]),
]),
]),
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(),
]),
]),
]),
I made a change and there it detects the inputs within the json, but I must have the select of the form inside the repeater, how do I make it detect it outside the repeater?
3 replies
FFilament
Created by Omar on 8/29/2023 in #❓┊help
How can I assign the options to a Select, when the options are inside a json?
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(),
]),
]),
]),
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(),
]),
]),
]),
4 replies
FFilament
Created by Omar on 8/28/2023 in #❓┊help
How can I make it work?
I'll keep it in mind, thanks
13 replies
FFilament
Created by Omar on 8/28/2023 in #❓┊help
How can I make it work?
this way worked for me, thank you very much
13 replies