src/Synapse/User/UserRolePivotMapper.php
public function findRoleNamesByUserId($userId)
    {
        $query = $this->getSqlObject()
            ->select()
            ->join('user_roles', 'user_roles.id = pvt_roles_users.role_id', ['name'])
            ->where(['user_id' => $userId]);

        $results = $this->execute($query)->toArray();

        return Arr::pluck($results, 'name');
    }
public function findRoleNamesByUserId($userId)
    {
        $query = $this->getSqlObject()
            ->select()
            ->join('user_roles', 'user_roles.id = pvt_roles_users.role_id', ['name'])
            ->where(['user_id' => $userId]);

        $results = $this->execute($query)->toArray();

        return Arr::pluck($results, 'name');
    }
public function findRoleNamesByUserId ( $ userId ) { $ query = $ this -> getSqlObject ( ) -> select ( ) -> join ( 'user_roles' , 'user_roles.id = pvt_roles_users.role_id' , [ 'name' ] ) -> where ( [ 'user_id' => $ userId ] ) ; $ results = $ this -> execute ( $ query ) -> toArray ( ) ; return Arr :: pluck ( $ results , 'name' ) ; }
Find roles for a user by user ID

@param  string $userId
@return array  Array of role names
Find roles for a user by user ID