0

I am trying to get Spatie Media Library to work, but I have this error: Error

I really don't know where it comes from, any suggestions?

I'll leave a copy of the portion of the code where the error happens

Str.php

/**
 * Replace the given value in the given string.
 *
 * @param  string|string[]  $search
 * @param  string|string[]  $replace
 * @param  string|string[]  $subject
 * @return string
 */
public static function replaceArray($search, array $replace, $subject)
{
    $segments = explode($search, $subject);

    $result = array_shift($segments);

    foreach ($segments as $segment) {
        $result .= (array_shift($replace) ?? $search).$segment;
    }

    return $result;
}
apokryfos
  • 38,771
  • 9
  • 70
  • 114

0 Answers0