Update Livewire integration for Tenancy by path#206
Update Livewire integration for Tenancy by path#206kaisersly wants to merge 3 commits intostancl:masterfrom
Conversation
I made some minor changes to @FelipeVeiga proposal and added them to the documentation. archtechx/tenancy#628 (comment)
|
|
||
| (Don't forget to import the middleware class.) | ||
|
|
||
| Open the `config/livewire.php` file and add this: |
There was a problem hiding this comment.
As @andreasmatu pointed out in archtechx/tenancy#628 (comment), this should be something like routes/tenant.php:
| Open the `config/livewire.php` file and add this: | |
| Open the `routes/tenant.php` file and add this: |
|
@lukinovec can you test this, check why the build is failing, and see if file uploads work for you: archtechx/tenancy#628 (comment) |
Co-authored-by: lukinovec <lukinovec@gmail.com>
I couldn't make them work yet. When I select a file, LW sends a post request to |
|
I don't think universal routes would fix anything here. They're a thing that's for domains, and even if they worked here, it would just skip tenant identification which is not what we want. Instead, the approach should be customizing the path used for file uploads, similar to the other change that was made here. |
|
I see. For me, LW works with the prefixed |
|
Try to focus on finding if this is possible:
|
|
Adding Route::post('/livewire/upload-file', [FileUploadHandler::class, 'handle'])->name('livewire.upload-file');to the tenant routes fixed the file uploads (same place where the guide suggests adding the Also, we should put |
|
@lukinovec So is it possible to make LW work in both tenant & central apps with path identification? I think in our convo on BC it seemed that it's not, but here you're suggesting adding an |
That only fixes a smaller problem this PR has (it assumes that |
|
I wonder if we could make it work by adding something like "query string identification". That wouldn't require re-defining the route since the path is the same, the ID would be passed as a query parameter and used by a middleware. |
|
Netlify should be fixed for the next commit |
Sounds like that could work, but I'm not sure |
|
@lukinovec Can you make a BC task for that? |
I made some minor changes to @FelipeVeiga proposal and added them to the documentation.
See archtechx/tenancy#628 (comment)