first change
This commit is contained in:
43
Modules/User/app/Models/ActivityLog.php
Normal file
43
Modules/User/app/Models/ActivityLog.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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();
|
||||
// }
|
||||
}
|
Reference in New Issue
Block a user