Последняя версия с сервера прошлого разработчика
This commit is contained in:
45
app/Domain/Comments/Models/Comment.php
Executable file
45
app/Domain/Comments/Models/Comment.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
namespace App\Domain\Comments\Models;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Model;
|
||||
use App\Domain\Feeds\Models\Feed;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Domain\Complaints\Models\CommentComplaint;
|
||||
|
||||
class Comment extends Model
|
||||
{
|
||||
|
||||
use SoftDeletes;
|
||||
|
||||
public function feed()
|
||||
{
|
||||
return $this->belongsTo(Feed::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function answer_to()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'to_user_id');
|
||||
}
|
||||
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(Comment::class, 'parent_id');
|
||||
}
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(Comment::class, 'parent_id');
|
||||
}
|
||||
|
||||
|
||||
public function complaints()
|
||||
{
|
||||
return $this->hasMany(CommentComplaint::class);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user