<?php

namespace App\Models;

use App\Models\User\User;
use Illuminate\Database\Eloquent\Model;

class History extends Model {
    protected $table = 'history';
    protected $fillable = [
        'user_id',
        'action',
        'context',
    ];

    public $casts = [
        'context' => 'json',
    ];


    public function user() {
        return $this->belongsTo(User::class);
    }

    public function owner() {
        return $this->morphTo();
    }
}
