<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Remark extends AbstractModel
{
    use SoftDeletes;

    protected $table = 'remarks';

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

    /**
     * @return BelongsTo
     */
    public function commenter(): BelongsTo
    {
        return $this->BelongsTo(User::class, 'commenter_id', 'id');
    }
}
