guessExtension(); // move to media folder and overwrite file if already existing $file->move( config('App')->mediaRoot . '/' . $podcast_name . '/', $file_name, true ); return $podcast_name . '/' . $file_name; } /** * Prefixes the root media path to a given uri * * @param mixed $uri URI string or array of URI segments * @return string */ function media_path($uri = ''): string { // convert segment array to string if (is_array($uri)) { $uri = implode('/', $uri); } $uri = trim($uri, '/'); return config('App')->mediaRoot . '/' . $uri; }