GitHub

Payload

The payload can contain any data you want to send to the frontend for possible further processing in JavaScript.
Controller.php
namespace App\Http\Controllers;

use App\Arch\BigPipe\AsyncResponse;
use dobron\BigPipe\TransportMarker;
use Illuminate\Http\Request;

class UsersController extends Controller
{
    public function checkUsername(Request $request)
    {
        ...

        return (new AsyncResponse())
            ->setPayload([
                'username' => $username,
                'status' => $status,
                'message' => TransportMarker::html($message),
            ])
            ->send();
    }
}
Try it

Only usernames with a number are available.

A live username check

Every keystroke (debounced) sends an AsyncRequest. The server answers with a payload, and the module of the page shows it.