'object', 'accomodation_cost' => 'object', 'onetime_cost' => 'object', 'service_cost' => 'object' ]; public function country() { return $this->belongsTo(Country::class, 'country_id'); } public function stayTypeLiving(): BelongsToMany { return $this->belongsToMany(StayType::class, 'living_costs', 'cost_calculator_id', 'stay_type_id')->withPivot('id', 'monthly', 'yearly')->withTimestamps(); } public function stayTypeAccomodation(): BelongsToMany { return $this->belongsToMany(StayType::class, 'accomodation_costs', 'cost_calculator_id', 'stay_type_id')->withPivot('id', 'monthly', 'yearly')->withTimestamps(); } public function stayTypeOnetime(): BelongsToMany { return $this->belongsToMany(StayType::class, 'onetime_costs', 'cost_calculator_id', 'stay_type_id')->withPivot('id', 'visa', 'biometrics', 'sevis', 'application')->withTimestamps(); } public function stayTypeService(): BelongsToMany { return $this->belongsToMany(StayType::class, 'service_costs', 'cost_calculator_id', 'stay_type_id')->withPivot('id', 'flight_ticket', 'insurance', 'extra')->withTimestamps(); } }