mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
Livewire 3 file uploads
This commit is contained in:
parent
f376bf88e5
commit
d6233d0df2
1 changed files with 13 additions and 1 deletions
|
|
@ -40,7 +40,19 @@ public function boot(): void
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
(Don't forget to import the middleware class.)
|
To make file uploads work on Livewire 3, set the following in any service provider:
|
||||||
|
```php
|
||||||
|
// specify the right identification middleware
|
||||||
|
FilePreviewController::$middleware = ['web', 'universal', InitializeTenancyByDomain::class];
|
||||||
|
```
|
||||||
|
|
||||||
|
And change `livewire.temporary_file_upload.middleware` to include the tenancy middleware as well:
|
||||||
|
|
||||||
|
```php
|
||||||
|
// config/livewire.php
|
||||||
|
|
||||||
|
'livewire.temporary_file_upload.middleware' => ['throttle:60,1', 'universal', InitializeTenancyByDomain::class],
|
||||||
|
```
|
||||||
|
|
||||||
Now you can use Livewire both in the central app and the tenant app.
|
Now you can use Livewire both in the central app and the tenant app.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue