public static function tracePhonyCall(array $trace): array
    {
        $prefix = 'Eloquent\Phony\\';

        for ($i = count($trace) - 1; $i >= 0; --$i) {
            $entry = $trace[$i];

            if (isset($entry['class'])) {
                if (0 === strpos($entry['class'], $prefix)) {
                    return $entry;
                }
            } elseif (0 === strpos($entry['function'], $prefix)) {
                return $entry;
            }
        }

        return [];
    }