<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Rating extends Model
{
    use HasFactory;

    protected $fillable = [
        'user_id',
        'borrow_transaction_id',
        'rating',
        'feedback' 
    ];

    public function transaction()
    {
        return $this->belongsTo(BorrowTransaction::class, 'borrow_transaction_id');
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}

