app/Auth/DmUserProvider.php
/**
     * @param array $credentials
     * @return DmUser
     * @throws AuthenticationException
     */
@param array $credentials
@return DmUser
@throws AuthenticationException
@param array $credentials @return DmUser @throws AuthenticationException
public function retrieveByCredentials(array $credentials) {
        self::$dmClient = resolve(DmClient::class);
        $query = "
            SELECT 
              users.ID,
              users.username,
              users.password,
              (SELECT privilege FROM users_permissions WHERE username = users.username AND users_permissions.role = 'EdgeCreator') AS privilege
            FROM users
            WHERE users.username ='{$credentials['username']}' AND users.password = '{$credentials['password']}'";
        $result = self::$dmClient->getQueryResults($query, self::$dmClient->DB_DM);
        if (count($result) === 0) {
            throw new AuthenticationException('Invalid credentials !');
        }
        return new DmUser($result[0]->ID, $result[0]->username, $result[0]->password, $result[0]->privilege);
    }
public function retrieveByCredentials ( array $ credentials ) { self :: $ dmClient = resolve ( DmClient :: class ) ; $ query = " 
            SELECT 
              users.ID,
              users.username,
              users.password,
              (SELECT privilege FROM users_permissions WHERE username = users.username AND users_permissions.role = 'EdgeCreator') AS privilege
            FROM users
            WHERE users.username =' { $ credentials [ 'username' ] } ' AND users.password = ' { $ credentials [ 'password' ] } ' " ; $ result = self :: $ dmClient -> getQueryResults ( $ query , self :: $ dmClient -> DB_DM ) ; if ( count ( $ result ) === 0 ) { throw new AuthenticationException ( 'Invalid credentials !' ) ; } return new DmUser ( $ result [ 0 ] -> ID , $ result [ 0 ] -> username , $ result [ 0 ] -> password , $ result [ 0 ] -> privilege ) ; }
@param array $credentials
 @return DmUser
 @throws AuthenticationException
@param array $credentials @return DmUser @throws AuthenticationException