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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user