44 lines
921 B
PHP
44 lines
921 B
PHP
<?php
|
|
|
|
namespace Modules\User\Models;
|
|
|
|
use App\Models\User;
|
|
use App\Traits\CreatedUpdatedBy;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|
// use Modules\User\Database\Factories\ActivityLogFactory;
|
|
|
|
class ActivityLog extends Model
|
|
{
|
|
use HasFactory, CreatedUpdatedBy;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected $fillable = [
|
|
'title',
|
|
'data',
|
|
'loggable_type',
|
|
'loggable_id',
|
|
'createdby',
|
|
'updatedby',
|
|
];
|
|
|
|
|
|
public function loggable(): MorphTo
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
|
|
public function createdBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'createdby');
|
|
}
|
|
|
|
// protected static function newFactory(): ActivityLogFactory
|
|
// {
|
|
// // return ActivityLogFactory::new();
|
|
// }
|
|
}
|