/** * Refresh the User and their associated Groups from the DB. * * @see http://stackoverflow.com/a/27748794/2970321 */ public function fresh(array $options = []) { // TODO: Update table and column info, in case it has changed? $user = parent::fresh($options); $user->getGroupIds(); $user->_primary_group = $user->fetchPrimaryGroup(); return $user; }