mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
Unless aliased, when going thru the dox on setting up Livewire using the previous code will fail with an error: Target class "[InitializeTenancyByDomain]" does not exist. Changing it to the full namespace works fine.
30 lines
762 B
Markdown
30 lines
762 B
Markdown
---
|
||
title: Livewire integration
|
||
extends: _layouts.documentation
|
||
section: content
|
||
---
|
||
|
||
# Livewire {#livewire}
|
||
|
||
Open the `config/livewire.php` file and change this:
|
||
|
||
```php
|
||
'middleware_group' => ['web'],
|
||
```
|
||
|
||
to this:
|
||
|
||
```php
|
||
'middleware_group' => [
|
||
'web',
|
||
'universal',
|
||
Stancl\Tenancy\Middleware\InitializeTenancyByDomain::class, // or whatever tenancy middleware you use
|
||
],
|
||
|
||
```
|
||
|
||
Now you can use Livewire both in the central app and the tenant app.
|
||
|
||
Also make sure to enable [universal routes]({{ $page->link('features/universal-routes') }}).
|
||
|
||
And if you're using file uploads, read the [Real-time facades]({{ $page->link('realtime-facades') }}) page of the documentation. Livewire uses real-time facades in the uploading logic.
|