4

I am using Trellis, Bedrock and sage theme from roots.io for a modern performance on WP. Everything works fine until I activate the sage theme (which I downloaded from composer [see: github.com/roots/sage]). So, when this theme is activated, it gives me an error :

Fatal error: Uncaught Error: Class 'Illuminate\Support\Collection' not found in /srv/www/example.com/current/web/app/themes/sage/vendor/illuminate/support/helpers.php on line 379

This is a part of helpers.php

<?php

use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Support\Collection;
use Illuminate\Support\Debug\Dumper;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\HigherOrderTapProxy;

if (! function_exists('append_config')) {
    /**
     * Assign high numeric IDs to a config item to force appending.
     *
     * @param  array  $array
     * @return array
     */
    function append_config(array $array)
    {
        $start = 9999;

        foreach ($array as $key => $value) {
            if (is_numeric($key)) {
                $start++;

                $array[$start] = Arr::pull($array, $key);
            }
        }

        return $array;
    }
}

if (! function_exists('collect')) {
    /**
     * Create a collection from the given value.
     *
     * @param  mixed  $value
     * @return \Illuminate\Support\Collection
     */
    function collect($value = null)
    {
        return new Collection($value);
    }
}

I didn't modified anything and it seems like I am the only one who has this kind of error, since even google can't help me :/ Why is there a "not found class" when clearly there is in helpers.php? How can I fix this?

0 Answers0