Example App

mar 20 post (edited)

Posted by admin on 3/20/2026

Customizing Livewire's update endpoint

When you need this: If your application uses route prefixes for localization (like /en/, /fr/) or multi-tenancy (like /tenant-1/, /tenant-2/), you may need to customize Livewire's update endpoint to match your routing structure.

By default, Livewire sends component updates to a hash-based endpoint like /livewire-{hash}/update, where {hash} is derived from your application's APP_KEY. To customize this, register your own route in a service provider (typically App\Providers\AppServiceProvider):

use Livewire\Livewire;
 
class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        Livewire::setUpdateRoute(function ($handle, $path) {
            return Route::post('/custom' . $path, $handle);
        });
    }
}
The $path parameter contains the hash-based path (e.g., /livewire-{hash}/update), preserving the unique-per-installation endpoint.
(edited)

0 0

Comments (0)

No comments yet. Be the first to comment!