Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

archi_23's avatar

css ,bootstrap and js not working in laravel proejct

I had a project developed in laravel 6. I developed it in my personal machine. It worked successfully . After long time when i tried to run it downloading from github , only html is working. No css, js or bootstrap working. What's the matter here and how to resolve it ? I didn't change anything. Everything is as same as when i finished up successfully.

0 likes
2 replies
Tray2's avatar

Make sure that the css file set in your views exists in the correct directory.

You can use the developer tools to see what might be missing.

1 like
KhanZain's avatar

If your Laravel project's CSS, JS, and Bootstrap files are not working after downloading from GitHub, there are a few potential reasons and troubleshooting steps you can take to resolve the issue:

  1. Check File Paths: Ensure that the paths to your CSS, JS, and Bootstrap files are correct in your HTML or Blade templates. When moving the project from one machine to another, file paths may need to be updated.

  2. Public Directory Permissions: In Laravel, static assets like CSS and JS files are typically stored in the public directory. Make sure that the permissions on this directory and its contents are set correctly so that the web server can access them.

  3. Run Composer Install: Make sure you have all the required dependencies installed by running composer install in the project directory. This command will install all the PHP dependencies defined in your composer.json file, including Laravel's dependencies.

  4. Run NPM/Yarn Install: If you're using Laravel Mix or any other build tools for compiling assets, run npm install or yarn install to install the required Node.js dependencies.

  5. Compile Assets: If you're using Laravel Mix or any other build tools, compile your assets by running npm run dev or yarn dev. This command will compile your CSS and JS assets into the public directory.

  6. Check .env File: Make sure your .env file is configured correctly, especially if you're using environment variables for asset URLs or paths.

  7. Clear Cache: Sometimes, stale cache files can cause issues. Run php artisan cache: clear and php artisan config: clear to clear Laravel's cache.

  8. Check Server Configuration: Ensure that your server configuration (e.g., Apache or Nginx) is set up correctly to serve static files. If you're using Apache, make sure mod_rewrite is enabled.

  9. Inspect Browser Console: Check your browser's developer console for any errors related to failed requests for CSS, JS, or Bootstrap files. This can give you insights into what might be going wrong.

  10. Check Git Ignore: Ensure that your CSS, JS, and Bootstrap files are not being ignored by your .gitignore file. Sometimes, developers unintentionally ignore these files, leading to them not being included in the Git repository.

By following these troubleshooting steps, you should be able to identify and resolve the issue with your Laravel project's CSS, JS, and Bootstrap files not working after downloading from GitHub.

1 like

Please or to participate in this conversation.