Crazylife's avatar

How can i get the the url of file inside the resources folder?

I want to get the file inside the resources folder, how can i get it?

i tried asset(), but it keeps show me error 404 not found. Is it i can't do it like how i access the public folder?

asset('resources/test')
0 likes
3 replies
lostdreamer_nl's avatar

only the 'public' folder is accessible via http.

Why would you want to open up the resources folder? This is just for your backend resources (un-compiled javascript / css, and your views)

If you want to store stuff for public access, either use "public/...." or "storage/app/public/..." and use the storage symlink php artisan storage:link to make it available via /public/storage.

newbie360's avatar

are you sure want to access the resources/test/files via http ?

or instead just put the test/files into storage/app/public/test/files, and use http://site/storage/test/files

if you want access the resources/test/files.jpg via http

method 1: use Alias in your web server conf, here an example for Apache

# this means http://site/test = project/resources/test
Alias /test "path_to_project/resources/test"
<Directory "path_to_project/resources/test">
    AllowOverride All
    Require local
</Directory>

or use method 2: make the symlink by youself, point the project/public/test to project/resources/test

here is an example for Windows run the CMD

mklink /J "X:\path_to_project\public\test" "X:\path_to_project\resources\test"

Please or to participate in this conversation.