belongsToMany(Host::class, "maintenance_host", "maintenance_id", "host_id" ); } public function history() { return $this->hasMany(MaintenanceHistory::class); } public function tasks() { return $this->hasMany(MaintenanceTask::class,); } public function guestor() { return $this->BelongsTo(User::class, 'guestor_id'); } }