22 خطوط
471 B
PHP
22 خطوط
471 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class MergeHistory extends Model
|
|
{
|
|
protected $fillable = ['entity_type', 'source_id', 'target_id', 'merged_fields', 'merged_by'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['merged_fields' => 'array'];
|
|
}
|
|
|
|
public function mergedBy(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'merged_by');
|
|
}
|
|
}
|