Update select with live API data

Hi all,
I've got a select which has a suffixAction to reload options from an API:

 Select::make('project_id')
        ->label('Project')
        ->options($this->projects)
        ->placeholder('Select a project')
        ->columnSpan(1)
        ->required()
        ->default('1207283586562118')
        ->suffixAction(
            Action::make('refreshProjects')
                ->label('Refresh projects')
                ->icon('heroicon-o-arrow-path')
                ->action(function (Select $component) {
                    $this->updateProjects();
                })

        ),


But although updateProjects() does get the correct format data from API, I can't get it to re-load the select box from the new data. Any ideas how to do this? I've searched here, but nothing worked.
Was this page helpful?