This line gives the error. Seems that the payload does not have an id
//this fails
$id = $update['payload']['id'];
//try this just before
if (!isset($update['payload']['id']) {
dd($update);
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
It shows me this HydrationMiddleware. Thank you for the help.
Illuminate\Foundation\Bootstrap\HandleExceptions::handleError
vendor/livewire/livewire/src/HydrationMiddleware/PerformActionCalls.php:27
{
public const PROTECTED_METHODS = [
'mount',
'hydrate*',
'dehydrate*',
'updating*',
'updated*',
];
public static function hydrate($unHydratedInstance, $request)
{
try {
foreach ($request->updates as $update) {
if ($update['type'] !== 'callMethod') continue;
$id = $update['payload']['id'];
$method = $update['payload']['method'];
$params = $update['payload']['params'];
throw_if(
str($method)->is(static::PROTECTED_METHODS),
new DirectlyCallingLifecycleHooksNotAllowedException($method, $unHydratedInstance->getName())
);
$unHydratedInstance->callMethod($method, $params, function ($returned) use ($unHydratedInstance,$method, $id) {
Livewire::dispatch('action.returned', $unHydratedInstance, $method, $returned, $id);
});
}
} catch (ValidationException $e) {
Livewire::dispatch('failed-validation', $e->validator);
This triggers when I hit a button.
@Snapey here is how It fixed. Just update your packages.json (see below)
"livewire/livewire": "^2.5"
To
"livewire/livewire": "^2.6.2"
//run the commands
composer update livewire/livewire
php artisan view:clear
php artisan livewire:publish --assets
Please or to participate in this conversation.