OwlCyberSecurity - MANAGER
Edit File: ProductComment.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class ProductComment extends Model { use HasFactory, SoftDeletes; protected $table = 'product_comments'; protected $fillable = [ 'product_id', 'rate', 'description', 'title', 'user_id', 'time', 'is_show', 'free_user', 'comment_id', 'url', 'article_id' ]; public $timestamps = true; public function user() { return $this->belongsTo(User::class); } public function replies() { return $this->hasMany(ProductComment::class, 'comment_id'); } public function parent() { return $this->belongsTo(ProductComment::class, 'comment_id'); } }