belongsTo(Location::class, 'locations_id', 'id'); } /** * Get the location that owns the vehicle. */ public function finalLocation() { return $this->belongsTo(Location::class, 'final_locations_id', 'id'); } public function ship() { return $this->hasOne(Vehicle::class, 'ship_id', 'id'); } }