public function getPath($path)
    {
        if (! is_array($path)) {
            $path = [$path];
        }

        $search_for = [
            '%BASE',
            '%STORAGE',
        ];

        $replace_by = [
            base_path(),
            storage_path(),
        ];

        if (function_exists('app_path')) {
            $search_for[] = '%APP';
            $replace_by[] = app_path();
        }

        if (function_exists('public_path')) {
            $search_for[] = '%PUBLIC';
            $replace_by[] = public_path();
        }

        $folders = str_replace($search_for, $replace_by, $path);

        foreach ($folders as $k => $v) {
            $folders[$k] = realpath($v);
        }

        return $folders;
    }
public function getPath($path)
    {
        if (! is_array($path)) {
            $path = [$path];
        }

        $search_for = [
            '%BASE',
            '%STORAGE',
        ];

        $replace_by = [
            base_path(),
            storage_path(),
        ];

        if (function_exists('app_path')) {
            $search_for[] = '%APP';
            $replace_by[] = app_path();
        }

        if (function_exists('public_path')) {
            $search_for[] = '%PUBLIC';
            $replace_by[] = public_path();
        }

        $folders = str_replace($search_for, $replace_by, $path);

        foreach ($folders as $k => $v) {
            $folders[$k] = realpath($v);
        }

        return $folders;
    }
public function getPath ( $ path ) { if ( ! is_array ( $ path ) ) { $ path = [ $ path ] ; } $ search_for = [ '%BASE' , '%STORAGE' , ] ; $ replace_by = [ base_path ( ) , storage_path ( ) , ] ; if ( function_exists ( 'app_path' ) ) { $ search_for [ ] = '%APP' ; $ replace_by [ ] = app_path ( ) ; } if ( function_exists ( 'public_path' ) ) { $ search_for [ ] = '%PUBLIC' ; $ replace_by [ ] = public_path ( ) ; } $ folders = str_replace ( $ search_for , $ replace_by , $ path ) ; foreach ( $ folders as $ k => $ v ) { $ folders [ $ k ] = realpath ( $ v ) ; } return $ folders ; }
Return an absolute path without predefined variables

@param string|array $path the relative path

@return array the absolute path
Return an absolute path without predefined variables