src/FontAwesome/FontAwesome.php
public function stack($icons)
    {
        if (count($icons) !== 2)
        {
            throw new \InvalidArgumentException('Expecting exactly 2 icons in the stack');
        }

        $contents = [];
        $index = 2;
        foreach ($icons as $key => $value)
        {
            $contents[] = $this->getStackIconElement($key, $value, $index);
            --$index;
        }

        return $this->html->span($contents)->addClass('fa-stack');
    }
public function stack($icons)
    {
        if (count($icons) !== 2)
        {
            throw new \InvalidArgumentException('Expecting exactly 2 icons in the stack');
        }

        $contents = [];
        $index = 2;
        foreach ($icons as $key => $value)
        {
            $contents[] = $this->getStackIconElement($key, $value, $index);
            --$index;
        }

        return $this->html->span($contents)->addClass('fa-stack');
    }
Stack two icons on top of each other. The array must contain exactly 2 elements.

An element of the array can either be:

- A simple string, in which case it is considered to be the icon name
- A key/value pair, both being strings, in which case the key is the icon name and the value will be added to
the icon css classes
- A FontAwesomeIcon object, obtained using the icon function.

@param array $icons The 2 icons to stack. First is back, second is front.

@return \Spatie\Html\Elements\Span

@throws \InvalidArgumentException