MIF_E31221305/TA_website/app/Models/TailorRating.php

38 lines
683 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class TailorRating extends Model
{
use HasFactory;
protected $fillable = [
'booking_id',
'customer_id',
'tailor_id',
'rating',
'review'
];
protected $casts = [
'rating' => 'decimal:1'
];
public function booking()
{
return $this->belongsTo(Booking::class);
}
public function customer()
{
return $this->belongsTo(User::class, 'customer_id');
}
public function tailor()
{
return $this->belongsTo(User::class, 'tailor_id');
}
}