38 lines
776 B
PHP
38 lines
776 B
PHP
<?php
|
|
|
|
namespace Modules\DocumentManagement\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
// use Modules\DocumentManagement\Database\Factories\DocumentApprovalFactory;
|
|
|
|
class DocumentApproval extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected $fillable = [
|
|
'document_id',
|
|
'approved_by',
|
|
'status',
|
|
'comments',
|
|
'approved_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'approved_at' => 'datetime',
|
|
];
|
|
|
|
public function document()
|
|
{
|
|
return $this->belongsTo(Document::class);
|
|
}
|
|
|
|
public function approver()
|
|
{
|
|
return $this->belongsTo(\App\Models\User::class, 'approved_by');
|
|
}
|
|
}
|