48 lines
995 B
PHP
48 lines
995 B
PHP
<?php
|
|
|
|
namespace Modules\Restaurant\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class FoodReview extends Model
|
|
{
|
|
protected $fillable = [
|
|
'restaurant_id',
|
|
'food_item_id',
|
|
'customer_id',
|
|
'rating',
|
|
'review',
|
|
'images',
|
|
'video_url',
|
|
'video_file',
|
|
'status',
|
|
'is_featured',
|
|
'position',
|
|
'helpful_count',
|
|
'created_at',
|
|
'updated_at',
|
|
'deleted_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'images' => 'array',
|
|
'is_featured' => 'boolean',
|
|
];
|
|
|
|
public const TABLE_NAME = 'food_reviews';
|
|
|
|
protected $table = self::TABLE_NAME;
|
|
|
|
public function replies(): HasMany
|
|
{
|
|
return $this->hasMany(FoodReviewReply::class, 'review_id');
|
|
}
|
|
|
|
public function customer(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Customer::class);
|
|
}
|
|
}
|