I am currently getting a CORS message in my console on my subdomains

Access to script at 'https://cyber.com/js/filament/forms/components/select.js?v=3.2.131.0' from origin 'https://is.cyber.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
14 Replies
toeknee
toeknee6d ago
That is because you are loading scripts from different domains... You need to update your CORS Policy to allow access to sub domains.
Alnuaimi
AlnuaimiOP6d ago
how to do it palse , this problem in cloud just ,A Local it is working with laragon
toeknee
toeknee6d ago
Laragon doesn't set CORS. your server is likely setting CORS. You can use AI to help with setting server CORS, I suspect you are running NGINX, just paste in your nginx config and ask AI to fix this error.
Bruno Pereira
Bruno Pereira6d ago
I had the same problem a couple months ago and It solved by putting this in the env file: SESSION_DOMAIN='.cyber.com' APP_DOMAIN='cyber.com' and then run:
php artisan config:cache

php artisan cache:clear
php artisan config:cache

php artisan cache:clear
Thats what I had to do to make filament with sub domain tenancy work.
Alnuaimi
AlnuaimiOP6d ago
APP_DOMAIN or APP_URL?
Bruno Pereira
Bruno Pereira6d ago
both app_url includes the protocol http or https in the session domain the "." needs to be there, it's not a typo
Alnuaimi
AlnuaimiOP6d ago
Is like this
No description
Bruno Pereira
Bruno Pereira6d ago
it's missing the APP_DOMAIN
Alnuaimi
AlnuaimiOP6d ago
now?
No description
Bruno Pereira
Bruno Pereira6d ago
looks right now you need to test it
Alnuaimi
AlnuaimiOP6d ago
stile bugs I'm use https://tenancyforlaravel.com/ localy it is work
Tenancy for Laravel
Automatic & flexible multi-tenancy package for Laravel.
Automatically turn any Laravel application multi-tenant — no code changes needed. stancl/tenancy automatically switches database connections and all other things in the background, letting you leverage standard Laravel code into a full SaaS application. Most features out of all multi-tenancy packages. Single & multi-database tenancy.
Bruno Pereira
Bruno Pereira6d ago
hmm then I don't know
Alnuaimi
AlnuaimiOP6d ago
ok ,why layout like this
No description
Bruno Pereira
Bruno Pereira6d ago
it worked for me with filament built in multi tenancy, if isnt working for you you can revert it.

Did you find this page helpful?