From a8fdadf3e542baa3a14ea2c226a214d896699aa4 Mon Sep 17 00:00:00 2001 From: Shahin Date: Wed, 13 Sep 2023 12:57:39 +0300 Subject: [PATCH] Update livewire.blade.md Update livewire integration instructions to refelect ivewire 3 changes. --- source/docs/v3/integrations/livewire.blade.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source/docs/v3/integrations/livewire.blade.md b/source/docs/v3/integrations/livewire.blade.md index c4cf46f..905009f 100644 --- a/source/docs/v3/integrations/livewire.blade.md +++ b/source/docs/v3/integrations/livewire.blade.md @@ -22,6 +22,25 @@ to this: ], ``` +For livewire 3, configuration key `middleware_group` has been removed, so instead in the `AppServiceProvider.php` add the following: + +```php +public function boot(): void + { + ... + + Livewire::setUpdateRoute(static function ($handle) { + return Route::post('/livewire/update', $handle) + ->middleware( + 'web', + 'universal', + InitializeTenancyByDomain::class, // or whatever tenancy middleware you use + ); + }); + } + +``` + (Don't forget to import the middleware class.) Now you can use Livewire both in the central app and the tenant app.