Update livewire.blade.md

Update livewire integration instructions to refelect ivewire 3 changes.
This commit is contained in:
Shahin 2023-09-13 12:57:39 +03:00 committed by GitHub
parent eceab47a75
commit a8fdadf3e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.