initial commit

This commit is contained in:
Dodowingster
2024-04-25 13:39:40 +08:00
parent 9879b16f2a
commit 3383f6b138
+27
View File
@@ -0,0 +1,27 @@
<?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');
}
}