cleaning day
This commit is contained in:
@@ -5,6 +5,8 @@ namespace App\Models\Core;
|
||||
use App\Traits\Model\HasComments;
|
||||
use Exception;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
class Comment extends Model
|
||||
{
|
||||
@@ -21,12 +23,12 @@ class Comment extends Model
|
||||
return $query->where('is_approved', true);
|
||||
}
|
||||
|
||||
public function commentable()
|
||||
public function commentable(): MorphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
public function commentator()
|
||||
public function commentator(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo($this->getAuthModelName(), 'user_id');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user