Can't load css files from theme folder - laravel

I am trying to load css files from themes folder which is in the root directory. But 404 error is thrown in the console:
GET http://127.0.0.1:8000/theme/elite/css/mainie.css net::ERR_ABORTED
404 (Not Found)
The files are there and working fine on the shared hosting. After downloading the project to my localhost this happened. Must say that I cleared all the caches if that is somehow related with the issue.
php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan view:clear
Checked other solution in stackoverf and github but couldn't make it.

When properly set up (or when using php artisan serve), the root directory is not accessible by browsers. This is important for security.
Only files in the public directory can be accessed in the browser, so move your themes folder into that and it should all work.

Related

How to upload Laravel Project to subdomain without database?

I am upload project file to Sub Domain. But In web site,just project files is showing. Project is not execute. How can i resolve this problem ?
Subdomain is active.
Your hosting and configuration should have the ff:
Appropriate PHP version compatible to your Laravel project.
Composer and Laravel installed.
Proper web server configuration for Apache, Nginx, Litespeed, etc. This is most likely where your problem is, where you should only expose the /public folder as the only public directory of your page.
I installed composer and I add .env file the run some commands like
php artisan key:generate
php artisan clear-compiled
php artisan cache:clear
php artisan config:clear
php artisan optimize
php artisan route:cache
Then resolved problem.

Edit some files in resources folder after production in Laravel

I am trying to edit some files (for example change the path of logo file) in resources folder in laravel project. After editing files which needed website is not updated.
I used :
php artisan config:clear
php artisan config:cache
php artisan cache:clear
but nothing helped. changes are not updated. Maybe I need to run some commands from ssh and make edition?

Laravel on VestaCP throws error 500. What file should I update to solve this problem?

When i try visiting my site I get this error, when I look domain.com.error.log:
PHP Fatal error: require(): Failed opening required '/home/<user/web/<domain>/public_html/../vendor/autoload.php
Files from my laravel project are placed into domain folder, files from public folder are inserted into /public_html folder. I've tried composer update, generate key, and all the other composer commands that people adviced here before.
I've set all my directories permissions to 777, so this error cannot be because of lacking permissions.
If you need any additional information, please ask, trying to solve this problem for 4 days already.
Edit: Solved this problem, it appeared because php didn't have access to files that are not inside public_html. So, this can be solved by either putting all your project into public_html folder, or updating your server rules to allow php access the folder with the project.
You need to install composer from www.getcomposer.org
composer dump-autoload
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php artisan migrate --force

Downloaded laravel project hangs on preloader when deployed on localhost

I'm trying to deploy a laravel project I have received onto my localhost but it hangs on the loading page and doesn't load the site.
I received the source code of a laravel project that was coded for me.
The deployed website on the shared hosting works properly, and I can also manipulate the files through my ftp access.
However, I'm trying to deploy the project on my localhost (as well as to migrate to a different shared hosting service).
I tried loading the server on wamp, homestead and with artisan serve, but all methods end up the same - the index.php seems to be loading, but is stuck eternally on the preloading .gif file and doesn't present the site.
the browser debugger is throwing a lot of javascript errors (see attached image)
I assume a have a config problem, but I can't locate it and I am unsure how to even locate & debug the issue.
I tried following these configuration steps:
1. changed .htaccess to generic laravel .htaccess (deleted cpanel related lines)
2. changed the .env to fit my wamp db / homestead db
3. composer install
4. composer update
5. php artisan key:generate
6. php artisan cache:clear
7. php artisan migrate
I also installed laravel-debugbar but it hasn't helped me out of the box, and I'm unsure where I need to try to catch the problem.
If anyone can give me pointers on how to understand my problem better, I would be very thankful.
Thanks in advance!
laravel bug
Double check your .env if all details are correct
Set APP_DEBUG=true in your .env file
Double check if your database exist and have data if you are using a database
Check if your host is added to /etc/hosts
Check if your host is added to apache/nginx config correctly
Try running these commands:
$ rm composer.lock package-lock.json
$ composer install
$ npm install
$ npm run dev
$ php artisan clear-compiled
$ php artisan optimize:clear
$ php artisan package:discover
$ php artisan storage:link
$ php artisan migrate:fresh && php artisan db:seed // optional!
Then clear browser cache to be safe.
Open web inspector to see if you can see any errors.
Open latest laravel log in storage/logs/ folder to debug.
If all fails, install laravel-debugbar and see if you can debug there.

storage/app/public/post contents is not in sync to asset public folder

I tried to link storage/app/public/post to public folder using php artisan storage:link but it shows the shortcut file on asset public folder it is not in sync with contents. I am using Laravel 5.5, please help me with this error
Try removing the storage folder from assets then run php artisan cache:clear and rerun the command php artisan storage:link you should get it.

Resources