F
Filamentβ€’10mo ago
bdm-laravel

css/js is not working in production

I deployed laravel filament on production server for testing but css / js file are not including or not working The laravel welcome as proper css / jss applied but when i try to access filament using /admin in url then there is no css / js Here is Dockerfile that install all dependencies composer and npm and working fine FROM php:8.2-apache Install dependencies RUN apt-get update && \ apt-get install -y \ libzip-dev \ zip \ libicu-dev \ nodejs \ npm Install PHP extensions RUN docker-php-ext-install pdo_mysql zip intl Install Composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer WORKDIR /app COPY . /app Update and install PHP dependencies before running composer install RUN composer update Print more information during composer install for debugging RUN composer install --verbose Install and build npm dependencies RUN npm install Run npm production build RUN npm run production EXPOSE 8000 CMD php artisan serve --host=0.0.0.0 --port=8000 NEED HELP IN THIS MATTER
No description
No description
16 Replies
Forever
Foreverβ€’10mo ago
i had this once. but that was an certificate issue so the browser didnt load the content until i accessed it manually once and "accepted" the security risk.
Dennis Koch
Dennis Kochβ€’10mo ago
Check your DevTools for console errors. Did you configure the APP_URL?
bdm-laravel
bdm-laravelOPβ€’10mo ago
YES, LET ME CHECK ONCE no there is no APP_URL
toeknee
toekneeβ€’10mo ago
It needs setting.
bdm-laravel
bdm-laravelOPβ€’10mo ago
I have only this in my production env APP_KEY=something DB_CONNECTION=something DB_HOST=something DB_PORT=something DB_DATABASE=laravel-testing DB_USERNAME=something DB_PASSWORD=something it working fine as per functionality wise
Dennis Koch
Dennis Kochβ€’10mo ago
Yeah, you should set the APP_URL to your production domain then.
toeknee
toekneeβ€’10mo ago
You need more than that, please review the env.example file.
Dennis Koch
Dennis Kochβ€’10mo ago
No, it's not. Otherwise we wouldn't have this convo, right? πŸ˜…
bdm-laravel
bdm-laravelOPβ€’10mo ago
Dennis Koch
Dennis Kochβ€’10mo ago
Yes
bdm-laravel
bdm-laravelOPβ€’10mo ago
kindly help me in this matter, i know this silly questions Let me try and deploy once
bdm-laravel
bdm-laravelOPβ€’10mo ago
Hi Guys, No luck I added more var in env APP_KEY=something APP_URL=https://laravel-testing-testing-app.e4se7i.easypanel.host/ APP_NAME=laravel APP_ENV=production APP_DEBUG=false DB_CONNECTION=something DB_HOST=something DB_PORT=something DB_DATABASE=laravel-testing DB_USERNAME=something DB_PASSWORD=something I cleared cache on serve then too same
No description
Dennis Koch
Dennis Kochβ€’10mo ago
Did you check the console errors and network tab?
bdm-laravel
bdm-laravelOPβ€’10mo ago
yes, it giving errors
No description
No description
Dennis Koch
Dennis Kochβ€’10mo ago
Well, it's good to read the errors. You are loading https assets from http. You should create a SSL cert or use http://
bdm-laravel
bdm-laravelOPβ€’10mo ago
okay, updating the htaccess Thanks a Lots Guys For The Quick Support It solved by using URL::forceScheme('https'); in AppServiceProvider
Want results from more Discord servers?
Add your server