products - common_codes - parts - products - files - price_histories - boms - bom_items boards - boards - board_settings - posts - board_comments - board_files - post_custom_field_values permissions - menus - roles - user_menu_permissions - role_menu_permissions tenants - tenants - plans - subscriptions - payments
30 lines
769 B
PHP
30 lines
769 B
PHP
<?php
|
|
|
|
namespace App\Models\Boards;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class BoardComment extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'board_comments';
|
|
protected $fillable = [
|
|
'post_id', 'tenant_id', 'user_id', 'parent_id', 'content', 'ip_address', 'status'
|
|
];
|
|
|
|
public function post() {
|
|
return $this->belongsTo(Post::class, 'post_id');
|
|
}
|
|
public function user() {
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
public function parent() {
|
|
return $this->belongsTo(BoardComment::class, 'parent_id');
|
|
}
|
|
public function children() {
|
|
return $this->hasMany(BoardComment::class, 'parent_id')->where('status', 'active');
|
|
}
|
|
}
|