mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-15 02:07:56 -04:00
29 lines
608 B
PHP
29 lines
608 B
PHP
<?php
|
|
|
|
namespace Modules\Blog\Entities;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class BlogComment extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
public function commentUser(){
|
|
|
|
return $this->belongsTo(\App\Models\User::class,'user_id');
|
|
}
|
|
|
|
public function replay(){
|
|
|
|
return $this->hasMany(BlogCommentReplay::class,'blog_comment_id')->where('replay_id',0);
|
|
}
|
|
|
|
public function reReplay($id){
|
|
return $this->hasMany(BlogCommentReplay::class,'blog_comment_id')->where('replay_id',$id);
|
|
}
|
|
|
|
}
|