[WIP] A
This commit is contained in:
48
app/Models/ClaimHistory.php
Normal file
48
app/Models/ClaimHistory.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\Blameable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ClaimHistory extends Model
|
||||
{
|
||||
use HasFactory, Blameable;
|
||||
|
||||
public $fillable = [
|
||||
'claim_id',
|
||||
'title',
|
||||
'description',
|
||||
'type',
|
||||
'parent_id',
|
||||
'data',
|
||||
'system_origin'
|
||||
];
|
||||
|
||||
public static $types = [
|
||||
'info',
|
||||
'document-request',
|
||||
'document-submit'
|
||||
];
|
||||
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(ClaimHistory::class, 'parent_id');
|
||||
}
|
||||
|
||||
public function childs()
|
||||
{
|
||||
return $this->hasMany(Claimhistory::class, 'parent_id');
|
||||
}
|
||||
|
||||
public function claim()
|
||||
{
|
||||
return $this->belongsTo(Claim::class, 'claim_id');
|
||||
}
|
||||
|
||||
public function historiable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user