Do not load resources - Laravel 5.4

0

Good morning. It turns out that I have a project in Laravel 5.4 which already works correctly if I run it both on my computer and in the local network. The problem arises when I try to run from another network (for example, from my cell phone) and do not load the scripts, css or images, it looks like this:

I have researched and followed the steps of this link without any success. What can be the cause and how to solve it?

After reviewing, I realized that the Laravel routes are changing my domain name to the server's IP, which is not allowing resources to be loaded (example: the route appears as http://11.11.120.120/Proyecto/public/css/app.css instead of http://mi.dominio/Proyecto/public/css/app.css ). I have already configured the .env and config / app.php files with the domain name and it continues to throw the route with the IP.

    
asked by Acentellao17 15.12.2017 в 15:55
source

1 answer

1

I finally found the solution. Effectively the mess was that Laravel was generating the route with the private IP and not with the name of the domain. To solve this, I added the following line to the routes / web.php file at the beginning of the code:

URL::forceRootUrl('http://mi.dominio/Proyecto/public');

I hope this can help someone.

    
answered by 15.12.2017 / 18:16
source