41 lines
818 B
PHP
41 lines
818 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\PointLogAction;
|
|
use App\Models\Admin\Administrator;
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PointLog extends Model
|
|
{
|
|
use HasFactory, HasDateTimeFormatter;
|
|
|
|
protected $fillable = [
|
|
'loggable_id',
|
|
'loggable_type',
|
|
'user_id',
|
|
'action',
|
|
'change_points',
|
|
'before_points',
|
|
'after_points',
|
|
'remark',
|
|
'administrator_id',
|
|
];
|
|
|
|
protected $casts = [
|
|
'action' => PointLogAction::class,
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function administrator()
|
|
{
|
|
return $this->belongsTo(Administrator::class);
|
|
}
|
|
}
|