password_hash = password_hash($password, PASSWORD_DEFAULT); } public function getExplorerObjectsSumPoints() { return $this->hasMany(UserExplorerObjects::class, ['user_id' => 'id']) ->joinWith('exploreObject')->sum('points'); } }