src/User/UserRepository.php
public function getIdForUsername($username, User $actor = null)
    {
        $query = User::where('username', 'like', $username);

        return $this->scopeVisibleTo($query, $actor)->value('id');
    }
public function getIdForUsername($username, User $actor = null)
    {
        $query = User::where('username', 'like', $username);

        return $this->scopeVisibleTo($query, $actor)->value('id');
    }
public function getIdForUsername ( $ username , User $ actor = null ) { $ query = User :: where ( 'username' , 'like' , $ username ) ; return $ this -> scopeVisibleTo ( $ query , $ actor ) -> value ( 'id' ) ; }
Get the ID of a user with the given username.

@param string $username
@param User|null $actor
@return int|null
Get the ID of a user with the given username .