Laravel Storage facade asset() with wrong URL generation
I've been working on my project and just can't get it about Laravel Storage, specifically, visibility : public
state of storage and its URL.
I do my uploaded file save via $filename = $file->store('mpmlimages', 'public');
From what I understand, when I put this $filename
at asset()
helper function, then I get my file URL.
In the current directory structure,
projectroot_folder
|-- storage <-- this is actual storage, right?
| |--app
| |--public
| |--mpmlimages <-- this is file location
|--public
|--storage (symlink to storageapppublic) <-- it has shortcut icon.. I believe it's what laravel said simbolic link
Fails to work if
I use asset($filename)
, I got http://localhost:8000/mpmlimages/{GENERATED_FILENAME}.png
Works if
Manually changing the above URL to http://localhost:8000/storage/mpmlimages/{GENERATED_FILENAME}.png
...WHY?!?!?!?!?!? I can't understand what I've missed.
php laravel
add a comment |
I've been working on my project and just can't get it about Laravel Storage, specifically, visibility : public
state of storage and its URL.
I do my uploaded file save via $filename = $file->store('mpmlimages', 'public');
From what I understand, when I put this $filename
at asset()
helper function, then I get my file URL.
In the current directory structure,
projectroot_folder
|-- storage <-- this is actual storage, right?
| |--app
| |--public
| |--mpmlimages <-- this is file location
|--public
|--storage (symlink to storageapppublic) <-- it has shortcut icon.. I believe it's what laravel said simbolic link
Fails to work if
I use asset($filename)
, I got http://localhost:8000/mpmlimages/{GENERATED_FILENAME}.png
Works if
Manually changing the above URL to http://localhost:8000/storage/mpmlimages/{GENERATED_FILENAME}.png
...WHY?!?!?!?!?!? I can't understand what I've missed.
php laravel
1
Why not use the storage_path helper to get actual files from the storage folder? Assets are images and icons used for your webpage specifically while storage could be for user uploads etc.
– Rimble
Nov 22 '18 at 13:38
Those images are actually user upload image. It's not icon but maybe some sort of user character image. Also I don't even understand what is difference betweenget actual file
andusing asset()
.. Is there any helpful keyword on this? The reason why I'm doing this question is actually I can't understand first word.Why not use the storage_path helper
... Is asset bad? ...
– GatesPlan
Nov 22 '18 at 14:30
Thanks to all. I now understand what's different between asset and storage_path , especially regards to Borisu's answer. Still not correctly understand what exactly happend during storing file but I think I got the concept of it.
– GatesPlan
Nov 25 '18 at 6:04
add a comment |
I've been working on my project and just can't get it about Laravel Storage, specifically, visibility : public
state of storage and its URL.
I do my uploaded file save via $filename = $file->store('mpmlimages', 'public');
From what I understand, when I put this $filename
at asset()
helper function, then I get my file URL.
In the current directory structure,
projectroot_folder
|-- storage <-- this is actual storage, right?
| |--app
| |--public
| |--mpmlimages <-- this is file location
|--public
|--storage (symlink to storageapppublic) <-- it has shortcut icon.. I believe it's what laravel said simbolic link
Fails to work if
I use asset($filename)
, I got http://localhost:8000/mpmlimages/{GENERATED_FILENAME}.png
Works if
Manually changing the above URL to http://localhost:8000/storage/mpmlimages/{GENERATED_FILENAME}.png
...WHY?!?!?!?!?!? I can't understand what I've missed.
php laravel
I've been working on my project and just can't get it about Laravel Storage, specifically, visibility : public
state of storage and its URL.
I do my uploaded file save via $filename = $file->store('mpmlimages', 'public');
From what I understand, when I put this $filename
at asset()
helper function, then I get my file URL.
In the current directory structure,
projectroot_folder
|-- storage <-- this is actual storage, right?
| |--app
| |--public
| |--mpmlimages <-- this is file location
|--public
|--storage (symlink to storageapppublic) <-- it has shortcut icon.. I believe it's what laravel said simbolic link
Fails to work if
I use asset($filename)
, I got http://localhost:8000/mpmlimages/{GENERATED_FILENAME}.png
Works if
Manually changing the above URL to http://localhost:8000/storage/mpmlimages/{GENERATED_FILENAME}.png
...WHY?!?!?!?!?!? I can't understand what I've missed.
php laravel
php laravel
edited Nov 22 '18 at 15:13
Diogo Santo
53318
53318
asked Nov 22 '18 at 13:31
GatesPlanGatesPlan
140119
140119
1
Why not use the storage_path helper to get actual files from the storage folder? Assets are images and icons used for your webpage specifically while storage could be for user uploads etc.
– Rimble
Nov 22 '18 at 13:38
Those images are actually user upload image. It's not icon but maybe some sort of user character image. Also I don't even understand what is difference betweenget actual file
andusing asset()
.. Is there any helpful keyword on this? The reason why I'm doing this question is actually I can't understand first word.Why not use the storage_path helper
... Is asset bad? ...
– GatesPlan
Nov 22 '18 at 14:30
Thanks to all. I now understand what's different between asset and storage_path , especially regards to Borisu's answer. Still not correctly understand what exactly happend during storing file but I think I got the concept of it.
– GatesPlan
Nov 25 '18 at 6:04
add a comment |
1
Why not use the storage_path helper to get actual files from the storage folder? Assets are images and icons used for your webpage specifically while storage could be for user uploads etc.
– Rimble
Nov 22 '18 at 13:38
Those images are actually user upload image. It's not icon but maybe some sort of user character image. Also I don't even understand what is difference betweenget actual file
andusing asset()
.. Is there any helpful keyword on this? The reason why I'm doing this question is actually I can't understand first word.Why not use the storage_path helper
... Is asset bad? ...
– GatesPlan
Nov 22 '18 at 14:30
Thanks to all. I now understand what's different between asset and storage_path , especially regards to Borisu's answer. Still not correctly understand what exactly happend during storing file but I think I got the concept of it.
– GatesPlan
Nov 25 '18 at 6:04
1
1
Why not use the storage_path helper to get actual files from the storage folder? Assets are images and icons used for your webpage specifically while storage could be for user uploads etc.
– Rimble
Nov 22 '18 at 13:38
Why not use the storage_path helper to get actual files from the storage folder? Assets are images and icons used for your webpage specifically while storage could be for user uploads etc.
– Rimble
Nov 22 '18 at 13:38
Those images are actually user upload image. It's not icon but maybe some sort of user character image. Also I don't even understand what is difference between
get actual file
and using asset()
.. Is there any helpful keyword on this? The reason why I'm doing this question is actually I can't understand first word. Why not use the storage_path helper
... Is asset bad? ...– GatesPlan
Nov 22 '18 at 14:30
Those images are actually user upload image. It's not icon but maybe some sort of user character image. Also I don't even understand what is difference between
get actual file
and using asset()
.. Is there any helpful keyword on this? The reason why I'm doing this question is actually I can't understand first word. Why not use the storage_path helper
... Is asset bad? ...– GatesPlan
Nov 22 '18 at 14:30
Thanks to all. I now understand what's different between asset and storage_path , especially regards to Borisu's answer. Still not correctly understand what exactly happend during storing file but I think I got the concept of it.
– GatesPlan
Nov 25 '18 at 6:04
Thanks to all. I now understand what's different between asset and storage_path , especially regards to Borisu's answer. Still not correctly understand what exactly happend during storing file but I think I got the concept of it.
– GatesPlan
Nov 25 '18 at 6:04
add a comment |
2 Answers
2
active
oldest
votes
The simplest solution is to prepend storage to the asset call:
asset("storage/{$filename}")
This way you don't have to create any symbolic links (besides the one you already have).
To answer the original question: calling $file->store
will use the public disk. If you check your config files you'll notice that the root of the public disk is 'root' => storage_path('app/public')
, so that's why your files land in the storage/app/public
folder.
Furthermore as a client you should only be able to access files in the public folder, hence the symbolic link to storage
. That's the reason you don't use storage_path()
as it will expose the webserver structure, instead of making a url the client can use. Example:
asset('storage/{$filename}')
results inhttps:/server.com/storage/file.png
storage_path($filename)
results in/var/www/server/storage/app/public/file.png
add a comment |
That is due to the fact that asset()
will point to public
folder.
By creating a symbolic link
from storage
to public
and using asset()
you still need to tell laravel which of the folder/files in public you wish to access.
In you case is your symbolic
link which will restructure the path to
storageapppublic`;
If you do a symbolic link
from storageapppublicmpmlimages
to publicmpmlimages
you can keep as asset('mpmlimages/<your img>')
What I think your symlink structure is
root
|--public
| |--**S**storage (storageapppublic)
|
|--storage
|--app
|--public
|--mpmlimages
|--img1.png
|--img2.jpeg
|-- etc
What your symlink should be in order for you to drop storage
root
|--public
| |--**S**mpmlimages(storageapppublicmpmlimages)
|
|--storage
|--app
|--public
|--mpmlimages
|--img1.png
|--img2.jpeg
|-- etc
Legend:
S -> As a Symlink indicator
To achieve this symlink relation, run:
ln -s storage/app/public/mpmlimages public/mpmlimages
Then if your $filename
contains mpmlimages/<img>
, all you need is:
asset($filename);
Thanks to reply. What your explain is when I usingasset()
, it should be likeasset('mpmlimages/{GENERATED_FILENAME}.png');
However, in my code,$filename
is alreadympmlimages/{GENERATED_FILENAME}.png
.
– GatesPlan
Nov 22 '18 at 14:20
1
If your symlink is created with the pointer like I explained above, then yes ^^
– Diogo Santo
Nov 22 '18 at 14:21
1
I will create a structure on my answer to better view this problem, bear with me a sec! :)
– Diogo Santo
Nov 22 '18 at 14:22
1
@gatesPlan let me know if it makes more sense and if it helps! :)
– Diogo Santo
Nov 22 '18 at 14:41
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432109%2flaravel-storage-facade-asset-with-wrong-url-generation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The simplest solution is to prepend storage to the asset call:
asset("storage/{$filename}")
This way you don't have to create any symbolic links (besides the one you already have).
To answer the original question: calling $file->store
will use the public disk. If you check your config files you'll notice that the root of the public disk is 'root' => storage_path('app/public')
, so that's why your files land in the storage/app/public
folder.
Furthermore as a client you should only be able to access files in the public folder, hence the symbolic link to storage
. That's the reason you don't use storage_path()
as it will expose the webserver structure, instead of making a url the client can use. Example:
asset('storage/{$filename}')
results inhttps:/server.com/storage/file.png
storage_path($filename)
results in/var/www/server/storage/app/public/file.png
add a comment |
The simplest solution is to prepend storage to the asset call:
asset("storage/{$filename}")
This way you don't have to create any symbolic links (besides the one you already have).
To answer the original question: calling $file->store
will use the public disk. If you check your config files you'll notice that the root of the public disk is 'root' => storage_path('app/public')
, so that's why your files land in the storage/app/public
folder.
Furthermore as a client you should only be able to access files in the public folder, hence the symbolic link to storage
. That's the reason you don't use storage_path()
as it will expose the webserver structure, instead of making a url the client can use. Example:
asset('storage/{$filename}')
results inhttps:/server.com/storage/file.png
storage_path($filename)
results in/var/www/server/storage/app/public/file.png
add a comment |
The simplest solution is to prepend storage to the asset call:
asset("storage/{$filename}")
This way you don't have to create any symbolic links (besides the one you already have).
To answer the original question: calling $file->store
will use the public disk. If you check your config files you'll notice that the root of the public disk is 'root' => storage_path('app/public')
, so that's why your files land in the storage/app/public
folder.
Furthermore as a client you should only be able to access files in the public folder, hence the symbolic link to storage
. That's the reason you don't use storage_path()
as it will expose the webserver structure, instead of making a url the client can use. Example:
asset('storage/{$filename}')
results inhttps:/server.com/storage/file.png
storage_path($filename)
results in/var/www/server/storage/app/public/file.png
The simplest solution is to prepend storage to the asset call:
asset("storage/{$filename}")
This way you don't have to create any symbolic links (besides the one you already have).
To answer the original question: calling $file->store
will use the public disk. If you check your config files you'll notice that the root of the public disk is 'root' => storage_path('app/public')
, so that's why your files land in the storage/app/public
folder.
Furthermore as a client you should only be able to access files in the public folder, hence the symbolic link to storage
. That's the reason you don't use storage_path()
as it will expose the webserver structure, instead of making a url the client can use. Example:
asset('storage/{$filename}')
results inhttps:/server.com/storage/file.png
storage_path($filename)
results in/var/www/server/storage/app/public/file.png
edited Nov 22 '18 at 15:42
answered Nov 22 '18 at 14:56
BorisuBorisu
49028
49028
add a comment |
add a comment |
That is due to the fact that asset()
will point to public
folder.
By creating a symbolic link
from storage
to public
and using asset()
you still need to tell laravel which of the folder/files in public you wish to access.
In you case is your symbolic
link which will restructure the path to
storageapppublic`;
If you do a symbolic link
from storageapppublicmpmlimages
to publicmpmlimages
you can keep as asset('mpmlimages/<your img>')
What I think your symlink structure is
root
|--public
| |--**S**storage (storageapppublic)
|
|--storage
|--app
|--public
|--mpmlimages
|--img1.png
|--img2.jpeg
|-- etc
What your symlink should be in order for you to drop storage
root
|--public
| |--**S**mpmlimages(storageapppublicmpmlimages)
|
|--storage
|--app
|--public
|--mpmlimages
|--img1.png
|--img2.jpeg
|-- etc
Legend:
S -> As a Symlink indicator
To achieve this symlink relation, run:
ln -s storage/app/public/mpmlimages public/mpmlimages
Then if your $filename
contains mpmlimages/<img>
, all you need is:
asset($filename);
Thanks to reply. What your explain is when I usingasset()
, it should be likeasset('mpmlimages/{GENERATED_FILENAME}.png');
However, in my code,$filename
is alreadympmlimages/{GENERATED_FILENAME}.png
.
– GatesPlan
Nov 22 '18 at 14:20
1
If your symlink is created with the pointer like I explained above, then yes ^^
– Diogo Santo
Nov 22 '18 at 14:21
1
I will create a structure on my answer to better view this problem, bear with me a sec! :)
– Diogo Santo
Nov 22 '18 at 14:22
1
@gatesPlan let me know if it makes more sense and if it helps! :)
– Diogo Santo
Nov 22 '18 at 14:41
add a comment |
That is due to the fact that asset()
will point to public
folder.
By creating a symbolic link
from storage
to public
and using asset()
you still need to tell laravel which of the folder/files in public you wish to access.
In you case is your symbolic
link which will restructure the path to
storageapppublic`;
If you do a symbolic link
from storageapppublicmpmlimages
to publicmpmlimages
you can keep as asset('mpmlimages/<your img>')
What I think your symlink structure is
root
|--public
| |--**S**storage (storageapppublic)
|
|--storage
|--app
|--public
|--mpmlimages
|--img1.png
|--img2.jpeg
|-- etc
What your symlink should be in order for you to drop storage
root
|--public
| |--**S**mpmlimages(storageapppublicmpmlimages)
|
|--storage
|--app
|--public
|--mpmlimages
|--img1.png
|--img2.jpeg
|-- etc
Legend:
S -> As a Symlink indicator
To achieve this symlink relation, run:
ln -s storage/app/public/mpmlimages public/mpmlimages
Then if your $filename
contains mpmlimages/<img>
, all you need is:
asset($filename);
Thanks to reply. What your explain is when I usingasset()
, it should be likeasset('mpmlimages/{GENERATED_FILENAME}.png');
However, in my code,$filename
is alreadympmlimages/{GENERATED_FILENAME}.png
.
– GatesPlan
Nov 22 '18 at 14:20
1
If your symlink is created with the pointer like I explained above, then yes ^^
– Diogo Santo
Nov 22 '18 at 14:21
1
I will create a structure on my answer to better view this problem, bear with me a sec! :)
– Diogo Santo
Nov 22 '18 at 14:22
1
@gatesPlan let me know if it makes more sense and if it helps! :)
– Diogo Santo
Nov 22 '18 at 14:41
add a comment |
That is due to the fact that asset()
will point to public
folder.
By creating a symbolic link
from storage
to public
and using asset()
you still need to tell laravel which of the folder/files in public you wish to access.
In you case is your symbolic
link which will restructure the path to
storageapppublic`;
If you do a symbolic link
from storageapppublicmpmlimages
to publicmpmlimages
you can keep as asset('mpmlimages/<your img>')
What I think your symlink structure is
root
|--public
| |--**S**storage (storageapppublic)
|
|--storage
|--app
|--public
|--mpmlimages
|--img1.png
|--img2.jpeg
|-- etc
What your symlink should be in order for you to drop storage
root
|--public
| |--**S**mpmlimages(storageapppublicmpmlimages)
|
|--storage
|--app
|--public
|--mpmlimages
|--img1.png
|--img2.jpeg
|-- etc
Legend:
S -> As a Symlink indicator
To achieve this symlink relation, run:
ln -s storage/app/public/mpmlimages public/mpmlimages
Then if your $filename
contains mpmlimages/<img>
, all you need is:
asset($filename);
That is due to the fact that asset()
will point to public
folder.
By creating a symbolic link
from storage
to public
and using asset()
you still need to tell laravel which of the folder/files in public you wish to access.
In you case is your symbolic
link which will restructure the path to
storageapppublic`;
If you do a symbolic link
from storageapppublicmpmlimages
to publicmpmlimages
you can keep as asset('mpmlimages/<your img>')
What I think your symlink structure is
root
|--public
| |--**S**storage (storageapppublic)
|
|--storage
|--app
|--public
|--mpmlimages
|--img1.png
|--img2.jpeg
|-- etc
What your symlink should be in order for you to drop storage
root
|--public
| |--**S**mpmlimages(storageapppublicmpmlimages)
|
|--storage
|--app
|--public
|--mpmlimages
|--img1.png
|--img2.jpeg
|-- etc
Legend:
S -> As a Symlink indicator
To achieve this symlink relation, run:
ln -s storage/app/public/mpmlimages public/mpmlimages
Then if your $filename
contains mpmlimages/<img>
, all you need is:
asset($filename);
edited Nov 22 '18 at 14:44
answered Nov 22 '18 at 14:11
Diogo SantoDiogo Santo
53318
53318
Thanks to reply. What your explain is when I usingasset()
, it should be likeasset('mpmlimages/{GENERATED_FILENAME}.png');
However, in my code,$filename
is alreadympmlimages/{GENERATED_FILENAME}.png
.
– GatesPlan
Nov 22 '18 at 14:20
1
If your symlink is created with the pointer like I explained above, then yes ^^
– Diogo Santo
Nov 22 '18 at 14:21
1
I will create a structure on my answer to better view this problem, bear with me a sec! :)
– Diogo Santo
Nov 22 '18 at 14:22
1
@gatesPlan let me know if it makes more sense and if it helps! :)
– Diogo Santo
Nov 22 '18 at 14:41
add a comment |
Thanks to reply. What your explain is when I usingasset()
, it should be likeasset('mpmlimages/{GENERATED_FILENAME}.png');
However, in my code,$filename
is alreadympmlimages/{GENERATED_FILENAME}.png
.
– GatesPlan
Nov 22 '18 at 14:20
1
If your symlink is created with the pointer like I explained above, then yes ^^
– Diogo Santo
Nov 22 '18 at 14:21
1
I will create a structure on my answer to better view this problem, bear with me a sec! :)
– Diogo Santo
Nov 22 '18 at 14:22
1
@gatesPlan let me know if it makes more sense and if it helps! :)
– Diogo Santo
Nov 22 '18 at 14:41
Thanks to reply. What your explain is when I using
asset()
, it should be like asset('mpmlimages/{GENERATED_FILENAME}.png');
However, in my code, $filename
is already mpmlimages/{GENERATED_FILENAME}.png
.– GatesPlan
Nov 22 '18 at 14:20
Thanks to reply. What your explain is when I using
asset()
, it should be like asset('mpmlimages/{GENERATED_FILENAME}.png');
However, in my code, $filename
is already mpmlimages/{GENERATED_FILENAME}.png
.– GatesPlan
Nov 22 '18 at 14:20
1
1
If your symlink is created with the pointer like I explained above, then yes ^^
– Diogo Santo
Nov 22 '18 at 14:21
If your symlink is created with the pointer like I explained above, then yes ^^
– Diogo Santo
Nov 22 '18 at 14:21
1
1
I will create a structure on my answer to better view this problem, bear with me a sec! :)
– Diogo Santo
Nov 22 '18 at 14:22
I will create a structure on my answer to better view this problem, bear with me a sec! :)
– Diogo Santo
Nov 22 '18 at 14:22
1
1
@gatesPlan let me know if it makes more sense and if it helps! :)
– Diogo Santo
Nov 22 '18 at 14:41
@gatesPlan let me know if it makes more sense and if it helps! :)
– Diogo Santo
Nov 22 '18 at 14:41
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432109%2flaravel-storage-facade-asset-with-wrong-url-generation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Why not use the storage_path helper to get actual files from the storage folder? Assets are images and icons used for your webpage specifically while storage could be for user uploads etc.
– Rimble
Nov 22 '18 at 13:38
Those images are actually user upload image. It's not icon but maybe some sort of user character image. Also I don't even understand what is difference between
get actual file
andusing asset()
.. Is there any helpful keyword on this? The reason why I'm doing this question is actually I can't understand first word.Why not use the storage_path helper
... Is asset bad? ...– GatesPlan
Nov 22 '18 at 14:30
Thanks to all. I now understand what's different between asset and storage_path , especially regards to Borisu's answer. Still not correctly understand what exactly happend during storing file but I think I got the concept of it.
– GatesPlan
Nov 25 '18 at 6:04