F
Filamentβ€’9mo ago
MikeG

No styling on filament + Tenancy for Laravel

Hello, For some reason im not getting any styling when I head over to domain/admin. The network tab (chrome dev tools) is not throwing any loading errors yet no styling seems to be there. I do get a couple of errors in the console.
No description
No description
Solution:
assuming you're using tenancyforlaravel.com from the docs "You can disable tenancy of asset() in the config (tenancy.filesystem.asset_helper_tenancy)"...
Jump to solution
9 Replies
Lara Zeus
Lara Zeusβ€’9mo ago
the errors are coz the files are not loaded have you run npm run build?
MikeG
MikeGβ€’9mo ago
I have yes unfortunately, was hoping that would have fixed it, did not though My vite config, if it makes any difference:
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: true,
}),
],
});
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: true,
}),
],
});
Lara Zeus
Lara Zeusβ€’9mo ago
ummm, check the folder `public/js and css files do exist? long shot, but sometimes the browser block these files, but I am using 'brave' did you create custom theme? recheck the docs, maybe messed a step!
MikeG
MikeGβ€’9mo ago
I only installed it, no custom theme or anything, literal first time using filament haha It seems that theres something the Tenancy for Laravel package is doing, doesnt seem anything to do with Filament Delving deeping in to the code for the Tenancy package now to figure it out, will mark an answer if i figure it out for the next guy (or elaborate more on my findings) πŸ™‚
Lara Zeus
Lara Zeusβ€’9mo ago
there is an article about how to integrate it with filament but not published yet https://github.com/filamentphp/filamentphp.com/pull/219/files also I rembmer disable assets per tenent in the config solve some of the assets isseus
GitHub
filament integration with Tenancywithlaravel Full Guide Article by...
a step by step guide which will take your application from single user to multi-tenant application
MikeG
MikeGβ€’9mo ago
thank you for that! I've looked it over, doesnt seem relevant to my issue unfortunately.. It seems that the filament assets are forced to be loaded through a tenancy route. Im trying to figure out WHY (it seems tenancy is currently hijacking the assets() helper or something) and where it's expecting those files to be now/how to override it to not include filament in that
No description
Solution
Lara Zeus
Lara Zeusβ€’9mo ago
assuming you're using tenancyforlaravel.com from the docs "You can disable tenancy of asset() in the config (tenancy.filesystem.asset_helper_tenancy)"
MikeG
MikeGβ€’9mo ago
Oh haha, wish I read the 30 min ago πŸ₯² Ye thats exactly it, it seems they override it for tenant specific assets, which you can easily disable with that config parameter πŸ₯²
_andypeacock
_andypeacockβ€’9mo ago
Worked for me as well!