36 lines
659 B
PHP
36 lines
659 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|
|
|
/**
|
|
* @mixin IdeHelperLog
|
|
*/
|
|
class Log extends Model
|
|
{
|
|
protected $fillable = [
|
|
'user_id',
|
|
'loggable_type',
|
|
'loggable_id',
|
|
'action',
|
|
'content',
|
|
'ip',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
/**
|
|
* Get the parent loggable model (user, quote or requested quote).
|
|
*/
|
|
public function loggable(): MorphTo
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
}
|