This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi,
Although media_path
is still listed as a helper function in the docs (https://octobercms.com/docs/services/helpers#method-media-path), it appears that the function is undefined. The error is resolved if I call other helper functions, such as storage_path
.
Would appreciate confirmation on whether media_path
was removed.
Last updated
No problem, this has been added to the upgrade guide. Thank you for pointing it out
Removed Helper Paths
The uploads_path()
and media_path()
global functions have been removed. These functions were found to be unreliable for use as system methods since objects can be stored using external providers and won't always exist on disk.
If your code relies on these functions, you may use a replacement as following.
// media_path()
storage_path(config('system.storage.media.folder', 'media'));
// uploads_path
storage_path(config('system.storage.uploads.folder', 'uploads'));
1-4 of 4