Diff
This component is a wrapper around diff2html with a simpler API to quickly show diff between two strings.
Install
<head>
...
{{-- DIFF2HTML --}}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/xcode.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/bundles/css/diff2html.min.css" />
</head>
Examples
@php
$old = '{"age": 24, "name": "Mary"}';
$new = '{"age": 27, "name": "Marian"}';
@endphp
{{-- The `file-name` determines highlight language --}}
<x-diff :old="$old" :new="$new" file-name="extra.json" />
Made with
by
Robson Tenório and contributors.