41 lines
899 B
PHP
41 lines
899 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\PressReleaseStatus;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class PressReleaseStatusLog extends Model
|
|
{
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'press_release_id',
|
|
'changed_by_user_id',
|
|
'from_status',
|
|
'to_status',
|
|
'reason',
|
|
'source',
|
|
'created_at',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'created_at' => 'datetime',
|
|
'from_status' => PressReleaseStatus::class,
|
|
'to_status' => PressReleaseStatus::class,
|
|
];
|
|
}
|
|
|
|
public function pressRelease(): BelongsTo
|
|
{
|
|
return $this->belongsTo(PressRelease::class);
|
|
}
|
|
|
|
public function changedBy(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'changed_by_user_id');
|
|
}
|
|
}
|