fix: draft kegiatan hanya terlihat oleh kreator dan super_admin, hanya ketua yang bisa approve, hilangkan field status dari form, default status draft

This commit is contained in:
2026-04-04 07:35:52 +07:00
parent fcd3816825
commit 5e70336774
4 changed files with 24 additions and 11 deletions
+8
View File
@@ -21,6 +21,14 @@ class Activity extends Model
'executed_at' => 'datetime',
];
protected static function booted(): void
{
static::creating(function (Activity $activity) {
$activity->created_by ??= auth()->id();
$activity->status ??= 'draft';
});
}
public function creator(): BelongsTo
{
return $this->belongsTo(User::class, 'created_by');