Skip to content
Advertisement

Laravel files/folders not showing up in Public directory

I want to integrate TradingView’s charting library in my Laravel project.

I have copied the charting_library folder to the Public folder of Laravel.

After that, I have referenced the charting_library.min.js file from Blade files in view and the other resources related to it.

<script type="text/javascript" src="{{ asset('tradingview/charting_library/charting_library.min.js') }}">

All js files loads successfully, but the problem is that this charting_library.min.js calls an HTML file from a subdirectory where it returns a 404 Not Found error.

http://localhost:8000/charting_library/static/fa-tv-chart.37***ee.html 404 (Not Found)

Here is the file/folder structure:

enter image description here

I have checked loaded resources from chrome’s dev tools.

Laravel loads these referenced JS files, but it doesn’t load any other files which these files have requested and just returns 404.

enter image description here

The charting_library folder exists in the directory, it’s just something related to Laravel. I think it can’t see the directory’s contents.

I have tried to modify the .htaccess file but still no luck.

I even tried to mix charting_library.min.js via Webpack, changing autoload, but still, nothing happens.

Advertisement

Answer

I solved this issue by:

  1. Moving the project to wamp’s www folder.

  2. Moving charting_library and datafeeds folder to the root of laravel’s public. It seems tradingview’s widget constructor uses relative path’s for building whole chart. So when you place the charting_library inside a folder, it doesn’t resolve other assets. These folders should be exactly in the root.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement