camya
Multi tenancy with multiple database support
I made it work kind of. Works for a first test. Ideas to optimize it are welcome.
Tenant assets are now public available on
https://sport.my-site.test/tenant/post/123.png
I create the folders & public symlinks in CreateFrameworkDirectoriesForTenant
Added to...
In the custom route FileUrlMiddleware, i update the filesystems.disks.public.url
config value.
44 replies
Multi tenancy with multiple database support
Hm, I have to wait for the v4 release than.
Looks like symlinking the storage/tenant folders is also a challenge in v3.
artisan storage:link
does not work out of the box. Also this needs the tenancy.filesystem.url_override
parameter too in order to set the correct url, i guess.44 replies
Multi tenancy with multiple database support
These are my settings. Still using the v3.8.3 of stancl/tenancy.
'filesystem' => [
'suffix_base' => 'tenant',
'disks' => [
'local',
'public',
],
'root_override' => [
'local' => '%storage_path%/app/',
'public' => '%storage_path%/app/public/',
],
'suffix_storage_path' => true,
'asset_helper_tenancy' => false,
],
44 replies
Multi tenancy with multiple database support
@Dennis Koch Great tips. I used the two links below to set up "tenancy for laravel".
I still have a problem with the preview url in my Filament Form.
The uploaded files are correctly saved in the folder
/Development/valet/laravel-sites/filament-demo/storage/tenantsport/post/01HY2S9NP685FD3TFBCXRAF7RF.png
. Great.
The problem is that the preview in Filament is still loading from https://sport.my-site.test/storage/post/01HY2S9NP685FD3TFBCXRAF7RF.png
when it should be https://sport.my-site.test/storage/tenantsport/post/01HY2S9NP685FD3TFBCXRAF7RF.png
.
Do you have any idea what I am missing here?
Tenancy for Laravel - Livewire: https://tenancyforlaravel.com/docs/v3/integrations/livewire/#livewire
Tenancy for Laravel - Universal Routes: https://tenancyforlaravel.com/docs/v3/features/universal-routes44 replies
Multi tenancy with multiple database support
Hi Dennis, great that you've got it working. I am suffering with stancl/tenancy and Filament at the moment. (I use Filament Form and Table separately).
In stancl/tenancy the config "asset_helper_tenancy" is set to true.
- Filament styles/scripts - Loaded from the wrong folder:
"@FilamentStyles and @FilamentScripts load files from the /tenancy/ folder, which does not work. (e.g.
"@FilamentStyles and @FilamentScripts load files from the /tenancy/ folder, which does not work. (e.g.
"/tenancy/assets/js/filament/support/async-alpine.js?v=3.2.80.0"
) - If I set asset_helper_tenancy
= false it works.
- FileUpload:
File uploads are not saved to the subfolder of the tenancy folder (e.g. /storage/tenantsport/
), so preview does not work.
The tenancy folder (public disk) is set by stancl/tenancy to /Development/valet/laravel-sites/filament-demo/storage/tenantsport/app/public/
, but files are saved to /Development/valet/laravel-sites/filament-demo/storage/app/public/
by the Filament FileUpload. It looks like Filament is not using the filesystems.disks.public.root configuration value when saving the file.
I hope you can give me some ideas on how to make it work.
Are there changes in v4-alpha, which makes it more easy to use stancl/tenancy and Filament together?44 replies
Table: sortable() with counts() - Set initial orderBy "desc" possible?
Your
modifyQueryUsing()
orders the table initally, but this is not what i need.
1. Initially the table is only ordered by title. (This works)
2. Than, the user clicks on sort "comment count". Now the count should be sorted "desc"
on first click.
I'm searching for a solution for 2. (Setting the initial sort direction to for a sortable field) At the moment, the first "sort" click has always orderBy "asc"
by default.
I my example, the generated SQL is the following on first click (order by "comments_count" asc). This is the current default behavior of sortable fields.
... but i want this (order by "comments_count" desc) on first click:
5 replies
Table: sortable() with counts() - Set initial orderBy "desc" possible?
My posts table is initially orderdBy title. This works fine using
$table->defaultSort('title')
.
The problem is the default orderBy for the sortable field "comment_count". It's default set to "asc"
(e.g. from 0 comments -> Most comments). I can't figure out, how to set it to "desc"
as inital order direction. (e.g. from Most comments -> 0 comments)
Because of this, I have to click the sort button two times in order to sort it into the preferred direction. ("desc"
, e.g. from Most comments -> 0 comments)5 replies
Notification ->body('Some **bold** info') -- Markdown not parsed in V3
Created a PR: https://github.com/filamentphp/filament/pull/12534
7 replies
Notification ->body('Some **bold** info') -- Markdown not parsed in V3
Great Dennis, thank you for the hint. This works for me....
Notification::make()->body(str('Updated **post** 123')->markdown())->send();
Maye you can add this info to the V3 docs too.
Also, thank you, @PovilasKorop . I really appreciate your Laravel content. 🙂7 replies