public function getIdForUsername($username, User $actor = null)
    {
        $query = User::where('username', 'like', $username);

        return $this->scopeVisibleTo($query, $actor)->value('id');
    }