Bugfix in getScopes() Bug in Query and Cast the Resultobjects to Arrays

->join('oauth_scopes','oauth_session_token_scopes.session_access_token_id', '=', 'oauth_scopes.id')

to  

->join('oauth_scopes', 'oauth_session_token_scopes.scope_id', '=', 'oauth_scopes.id')

and cast the Object to an array, because in Resource the Function expects an Array and not an Object