thảo 🐧
How to refresh data balance when action is done in resource simple modal?
return $form
->schema([
Section::make('Information')
->schema([
Forms\Components\Grid::make()
->schema([
Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
Forms\Components\TextInput::make('short_name')
->required()
->readOnly()
->maxLength(50),
]),
Forms\Components\TextInput::make('api_url')
->required()
->maxLength(255),
Forms\Components\TextInput::make('api_key')
->required()
->maxLength(255),
Forms\Components\Grid::make(3)
->schema([
Forms\Components\TextInput::make('balance')
->disabled()
->suffix(fn(Provider $provider) => $provider->currency)
->suffixAction(
Action::make('copyCostToPrice')
->icon('heroicon-o-arrow-path')
->action(function (Provider $record) {
$record->balance = 1111111;
$record->save();
}),
),
Forms\Components\Toggle::make('is_active')
->inline(false),
]),
])
2 replies