tenancy-docs/source/docs/v3/integrations/livewire.blade.md
injektion 22e06dae4f
Update livewire.blade.md (#131)
* Update livewire.blade.md

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.

* Update livewire.blade.md

* remove indentation

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2021-07-07 17:43:10 +02:00

31 lines
763 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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',
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.
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.