Skip to content

Commit 66658ee

Browse files
committed
Add 'status' field to DaftarKegiatan and DaftarReminder models; update Stop Reminder action to use query for status update
1 parent 115f243 commit 66658ee

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

app/Models/DaftarKegiatan.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class DaftarKegiatan extends Model
1313
'rapat_internal_id',
1414
'jenis',
1515
'awal',
16+
'status',
1617
];
1718

1819
protected $casts = [

app/Models/DaftarReminder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class DaftarReminder extends Model
1010
protected $fillable = [
1111
'tanggal',
1212
'daftar_kegiatan_id',
13+
'status',
1314
];
1415

1516
protected $casts = [

app/Nova/DaftarKegiatan.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,8 @@ public function actions(NovaRequest $request)
237237
$actions[] =
238238
Action::using('Stop Reminder', function (ActionFields $fields, Collection $models) {
239239
$model = $models->first();
240-
$model->status = 'sent';
240+
$model->query()->where('id', $model->id)->update(['status' => 'sent']);
241241
$model->daftarReminder()->update(['status' => 'sent']);
242-
$model->save();
243242
})
244243
->showInline()
245244
->showOnDetail()

0 commit comments

Comments
 (0)