Dispatch laravel 传递变量

Dispatch laravel pass variable

我正在 dispatch laravel 中创建手动函数。有谁知道如何将变量传递给调度函数()?

$new_user = UserAccount::create($input);
$registered_id = $new_user->ID;
dispatch(function () {
    return $registered_id;
})->afterResponse();
dispatch(function () use ($registered_id) {
    return $registered_id;
})->afterResponse();