skip to Main Content

I worked on a team and then clone the laravel/php codes from our repository. When I serve the laravel on localhost, it cannot find all the file inside the public directory and throw an error on the terminal:

[404]: GET /public/css/style.css - No such file or directory

Many answers to similar issues advise me to change the codes in the blade.php file. The problem is that I can’t edit the blade.php because it works fine on other team members even though we have the same ubuntu, PHP, and laravel version and .env file.

What I have tried:

  • Run composer install and composer update
  • Try different browsers such as firefox and chromium-based browsers
  • Run php artisan storage:link
  • Restart apache2
  • Run npm install and npm run dev

I think there is some package or something missing.

List of paths I get from dd($__data):

"path" => "/project-directory/project-name/app"
"path.base" => "/project-directory/project-name"
"path.lang" => "/project-directory/project-name/resources/lang"
"path.config" => "/project-directory/project-name/config"
"path.public" => "/project-directory/project-name/public"
"path.storage" => "/project-directory/project-name/storage"
"path.database" => "/project-directory/project-name/database"
"path.resources" => "/project-directory/project-name/resources"
"path.bootstrap" => "/project-directory/project-name/bootstrap"

2

Answers


  1. Have you tried?

    php artisan storage:link
    
    Login or Signup to reply.
  2. You need first run

    php artisan storage:link
    

    For more details check https://laravel.com/docs/8.x/filesystem

    Then you must be check your .env values.
    Is correctly APP_URL=

    Also in your exception is strange

    /public/.../...
    

    Reason is wrong configuration.
    First check your .env values like

    APP_URL=...
    FILESYSTEM_DRIVER=public
    

    then check config/filesystems.php

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search