48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
// 1. Baris Spatie di-comment/dihapus
|
|
// use Spatie\Activitylog\Traits\LogsActivity;
|
|
// use Spatie\Activitylog\LogOptions;
|
|
|
|
class Sop extends Model
|
|
{
|
|
// 2. Trait LogsActivity di-comment/dihapus
|
|
// use LogsActivity;
|
|
|
|
protected $table = 'sops';
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'sop_code',
|
|
'category_name',
|
|
'version',
|
|
'revision_history',
|
|
'status'
|
|
];
|
|
|
|
protected $casts = [
|
|
'revision_history' => 'array',
|
|
];
|
|
|
|
// 3. Fungsi getActivitylogOptions di-comment/dihapus
|
|
/*
|
|
public function getActivitylogOptions(): LogOptions
|
|
{
|
|
return LogOptions::defaults()
|
|
->logFillable()
|
|
->logOnlyDirty()
|
|
->dontSubmitEmptyLogs()
|
|
->setDescriptionForEvent(fn(string $eventName) => "SOP {$eventName}");
|
|
}
|
|
*/
|
|
|
|
public function trainingMatrices(): HasMany
|
|
{
|
|
return $this->hasMany(TrainingMatrix::class, 'sop_id');
|
|
}
|
|
} |