chore: update document approval workflow and bug fixes
This commit is contained in:
37
Modules/DocumentManagement/app/Models/DocumentApproval.php
Normal file
37
Modules/DocumentManagement/app/Models/DocumentApproval.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user