@php $same = true; $data1_array = explode("\n",$data1); $data2_array = explode("\n",$data2); @endphp @for ($i = 0; $i < count($data1_array) && $i < count($data2_array); $i++) @if ($data1_array[$i] !== $data2_array[$i])
{{ $i }} - {{ $data1_array[$i] }}
{{ $i }} + {{ $data2_array[$i] }}
@php $same = false @endphp @endif @endfor @if ($same)
Identical content
@endif
{{ $data1 }}
{{ $data2 }}