HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/dashboard.orbiwheels.com/app/Models/RideRequest.php
<?php

namespace App\Models;

use App\Enums\RideRequestStatus;
use Illuminate\Database\Eloquent\Model;

class RideRequest extends Model
{
    protected $table = 'ride_requests';
    protected $fillable = [
        'booking_id',
        'trip_id',
        'transporter_id',
        'status',
    ];

    const PENDING  = 0; 
    const ACCEPTED = 1;
    const REJECTED = 2;
    const EXPIRED  = 3;

    public function getStatusLabel()
    {
        return [
            self::PENDING  => 'Pending',
            self::ACCEPTED => 'Accepted',
            self::REJECTED => 'Rejected',
            self::EXPIRED  => 'Expired',
        ];
    }

    public function transporter()
    {
        return $this->belongsTo(Transporter::class);
    }

    public function booking()
    {
        return $this->belongsTo(Booking::class,'booking_id');
    }
    public function trip()
    {
        return $this->belongsTo(Trip::class, 'trip_id');
    }
}