Is it possible to change the generated url by the laravel's url()
helper? This helper generates a url as: http://localhost/bluedrive/drive/public/
But I need the same url without /public
. Or can I create my own helper and in which file should I do that
Asked
Active
Viewed 259 times
0

Alex
- 485
- 6
- 18
-
1Why would you need that? If you want to access your base path - you can use 'base_path()' helper. and then append to it like 'base_path()' . '/something/' – naneri Dec 30 '15 at 09:21
-
@naneri This returns the path. I need a URL which will be appended to `
` – Alex Dec 30 '15 at 09:23
-
oh, I see. The better practice is to move the file from storage to public. check this question - http://stackoverflow.com/questions/30191330/laravel-5-how-to-access-image-uploaded-in-storage-within-view – naneri Dec 30 '15 at 09:49
-
@naneri The logic of my app is that these pics should net be visible to everyone. And I read that the storage directory is considered to be private. So this is the exact directory for these pics. That's why I need to address them like `http://localhost/bluedrive/drive/storage` – Alex Dec 30 '15 at 09:53
-
If you create a link to an image, it can be copy pasted to other users - this way images won't be private anymore anyway, even though they will reside in the 'storage' folder. You can make image returned by your framework as it was suggested in the first answer in the previous question, but this way, you will increase the load pressure on your hosting machine, due to resources spended on framework booting on every request just to host an image. You have to consider wisely. – naneri Dec 30 '15 at 09:57
-
You see, no matter if the image resides in public folder, or it will be in storage folder which will be opened to the users. Any way chance of guessing the image URL is the same. So you won't have any 'privacy' advantage. That is because initially 'storage' folder is not exposed to outer requests and if you open it, then it is no longer considered private... ;D – naneri Dec 30 '15 at 10:00
-
This seems to become a mission impossible – Alex Dec 30 '15 at 10:10
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/99295/discussion-between-naneri-and-alex). – naneri Dec 30 '15 at 10:12