I need to be able to get the absolute path in my controller and my views for a storage path. Some storage paths are different for different static assets in my Masonite application.
How can I do this?
I need to be able to get the absolute path in my controller and my views for a storage path. Some storage paths are different for different static assets in my Masonite application.
How can I do this?
Masonite has a helper for this. You can use it directly in your views like this:
Assuming a configuration like this:
You can do this:
this will result in an output like
/storage/directory/profile.jpgNow assuming you had a configuration file like this:
You can just slightly modify your static helper:
You can also use the helper outside of views by using
from masonite.helpers import static