Try reading up on the asset helper function. You can set the assets folder to be global_assets in your .env file and then use the helper function.
How does Laravel/Blade handle assets ?
Hello, I'm having a problem with my assets (images and js files).
I have created a global_asset folder inside my public folder.
I have created a resource controller ProjectController to route user either to the list of projects (index.blade.php) or to view a single project (show.blade.php)
Both index.blade.php and show.blade.php extends the same initial layout (my template.blade.php).
The PROBLEM:
in the template.blade.php I have included some assets like this:
<script src="global_assets/js/plugins/visualization/d3/d3.min.js"></script>
When the controller routes me to the index ( /domain/projects) (to show all projects), this works and all assets are accessed correctly.
When the controller routes me to the create.blade.php file to show only a single project ( /domain/projects/{idOfProject} ) this doesn't work, in telescope it shows that the assest are accessed as if they were in "/projects/global_assets/...."
Please or to participate in this conversation.