'decimal:2', 'price_for_driver' => 'decimal:2', 'price_for_passenger' => 'decimal:2', 'distance' => 'float', ]; // ── Relationships (cross-database via Primary) ── public function driver() { return $this->belongsTo(Driver::class, 'driver_id', 'id'); } public function passenger() { return $this->belongsTo(Passenger::class, 'passenger_id', 'id'); } // ── Scopes ── public function scopeActive($query) { return $query->whereIn('status', ['waiting', 'wait', 'Apply', 'Applied', 'Arrived', 'Begin']) ->where('created_at', '>=', now()->subHours(1)); } public function scopeForPassenger($query, string $passengerId) { return $query->where('passenger_id', $passengerId); } public function scopeForDriver($query, string $driverId) { return $query->where('driver_id', $driverId); } public function scopeWaiting($query) { return $query->whereIn('status', ['waiting', 'wait']); } }