Get the value of a field from a suffixAction

How can I get the value of a select field from a suffix action when the modal opens? I keep getting null when using $get
->schema([
Select::make('provider')
->options(
DatabaseProvider::getMysqlProviders(),
)
->live(),
])
->schema([
Select::make('provider')
->options(
DatabaseProvider::getMysqlProviders(),
)
->live(),
])
and I have another select
Select::make('cluster_id')
...
->suffixAction(
Action::make('cluster')
->form([
Select::make('size')
->options(function (Get $get) {
$provider = $get('credential') // this returns null
}
])
Select::make('cluster_id')
...
->suffixAction(
Action::make('cluster')
->form([
Select::make('size')
->options(function (Get $get) {
$provider = $get('credential') // this returns null
}
])
Thank you.
Solution:
try to inject $livewire ```php Select::make('size') ->options(function (Page $livewire) {...
Jump to solution
4 Replies
LeandroFerreira
LeandroFerreira3mo ago
where is credential?
Abdellah
Abdellah3mo ago
on the main form and not the modal form of the suffixAction @Leandro Ferreira
Solution
LeandroFerreira
LeandroFerreira3mo ago
try to inject $livewire
Select::make('size')
->options(function (Page $livewire) {
//$livewire->data['credential']
})
Select::make('size')
->options(function (Page $livewire) {
//$livewire->data['credential']
})
Abdellah
Abdellah3mo ago
Whoa! @Leandro Ferreira , I am speechless. Thank you a million times for this life-saving solution. You earn my respect.
Want results from more Discord servers?
Add your server