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
andcomposer update
- Try different browsers such as firefox and chromium-based browsers
- Run
php artisan storage:link
- Restart apache2
- Run
npm install
andnpm 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
Have you tried?
You need first run
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
Reason is wrong configuration.
First check your .env values like
then check config/filesystems.php