/** * Decides of any more usernames should be added to the database * Will add more if any more of the same length need to be added * Won't add more if above condition passes and there are some usernames still to check or some available usernames * * @return bool */ private function populateMoreUsernames() { $currentLength = TwitterUser::select(DB::raw('MAX(CHAR_LENGTH(username)) as Max'))->pluck('Max'); if (is_null($currentLength) || !TwitterUser::whereUsername(str_repeat('_', $currentLength))->exists()) { return true; } if (TwitterUser::neverQueried()->count() > 0 || TwitterUser::free()->count() > 0) { return false; } return true; }