codeplus / core /app /Models /Review.php
Softin Trading
Initial commit from Github
52d9fb0
Raw History Blame Contribute Delete
617 Bytes
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Review extends Model
{
public function product()
{
return $this->belongsTo(Product::class);
}
public function user()
{
return $this->belongsTo(User::class);
}
public function author()
{
return $this->belongsTo(User::class, 'author_id', 'id');
}
public function category()
{
return $this->belongsTo(ReviewCategory::class, 'review_category_id', 'id');
}
public function replies()
{
return $this->hasMany(Comment::class, 'review_id');
}
}