This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

daniel63
daniel63
        $baseUrl = url(Config::get('cms.storage.media.path'));

Config::get('cms.storage.media.path') returns the path used by the media manager.
url(somePath) converts the path to absolute url.

Mathilde Escher Stiftung
Mathilde Escher Stiftung

Should this still work with october v2?

I get this one:

Object of class Illuminate\Routing\UrlGenerator could not be converted to string

And when I dump Config::get('cms.storage.media.path') I get NULL.

helder_johrclaessens
helder_johrclaessens

Hey Mathilde,

You can use the following snippet to support both OctoberCMS V1.x and V2.x.

Config::get('cms.storage.media.path', Config::get('system.storage.media.path'))

OctoberCMS V2 uses system instead of cms. The snippet above will check for the V1 config first and will call the V2 config if it doesn't exist.

Last updated

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.