// This is SimcardResource class
...
public static function table(Table $table): Table
{
...
->actions([
Action::make('simcardActivate')
->label('Aktiver simkort')
->visible(fn (Simcard $record): bool => empty($record->Phone))
->form([
...
])
->action(function (array $data, Simcard $record): void {
$baserowApi = new BaserowApi();
$response = $baserowApi->updateRecord();
if ($response->successful()) {
Notification::make()
->title('Success!')
->body('Your action 1 was successful.')
->success()
->send();
}
})
])
}
// This is SimcardResource class
...
public static function table(Table $table): Table
{
...
->actions([
Action::make('simcardActivate')
->label('Aktiver simkort')
->visible(fn (Simcard $record): bool => empty($record->Phone))
->form([
...
])
->action(function (array $data, Simcard $record): void {
$baserowApi = new BaserowApi();
$response = $baserowApi->updateRecord();
if ($response->successful()) {
Notification::make()
->title('Success!')
->body('Your action 1 was successful.')
->success()
->send();
}
})
])
}