Replies: 1 comment
-
Hi. This kind of url contains 3 section. 1. Base url (server), 2. directory url, 3. File name Usually you have to store File name and by type model you have to realize the store directory and base url come from So you have to do something like this $base_url = env('APP_URL');
$url = "{$base_url}/{$directory_url}/{$model->href}"; Now you have a more semantically understandable and decoupled code |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Trying to upload and store some files using
Storage::putFile('/images')
and storing the resulting path in the database, which then gets used directly as hrefs.putFile
strips the leading slash however, resulting in a different URL entirely on most pages. Am I misunderstanding what the path argument is for, or why would it strip the leading slash? Trailing slash I might understand.Beta Was this translation helpful? Give feedback.
All reactions