PHPackages                             vi-kon/laravel-diff - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vi-kon/laravel-diff

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

vi-kon/laravel-diff
===================

Diff tool for Laravel 5

v1.0.2(10y ago)3025.9k↓18.4%9[2 issues](https://github.com/vi-kon/laravel-diff/issues)MITPHPPHP &gt;=5.5.9

Since Mar 1Pushed 10y ago2 watchersCompare

[ Source](https://github.com/vi-kon/laravel-diff)[ Packagist](https://packagist.org/packages/vi-kon/laravel-diff)[ Docs](https://github.com/vi-kon/laravel-diff)[ RSS](/packages/vi-kon-laravel-diff/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

Diff tool
=========

[](#diff-tool)

This package is for comparison strings and show changes.

Table of content
----------------

[](#table-of-content)

- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)

---

[Back to top](#diff-tool)

Features
--------

[](#features)

- compare **strings**
- compare **files**
- group string differences into **hunk groups**

Installation
------------

[](#installation)

Via `composer`:

```
composer require vi-kon/laravel-diff
```

---

[Back to top](#diff-tool)

Usage
-----

[](#usage)

Simple usage:

```
// Compare string line by line
$diff = Diff::compare("hello\na", "hello\nasd\na");
// Outputs span, ins, del HTML tags, depend if entry
// is unmodified, inserted or deleted
echo $diff->toHTML();
```

Compare two file:

```
// Compare files line by line
$diff = Diff::compareFiles("a.txt", "b.txt");
echo $diff->toHTML();
```

You can customize output by getting raw data:

```
$options = [
    // Compare by line or by characters
    'compareCharacters' => false,
    // Offset size in hunk groups
    'offset'            => 2,
];

$diff = Diff::compare("hello\na", "hello\nasd\na", $options);
$groups = $diff->getGroups();

foreach($groups as $i => $group)
{
    // Output: Hunk 1 : Lines 2 - 6
    echo 'Hunk ' . $i . ' : Lines '
         . $group->getFirstPosition() . ' - ' . $group->getLastPosition();

    // Output changed lines (entries)
    foreach($group->getEntries() as $entry)
    {
        // Output old position of line
        echo $entry instanceof \ViKon\Diff\Entry\InsertedEntry
            ? '-'
            : $entry->getOldPosition() + 1;

        echo ' | ';

        // Output new position of line
        echo $entry instanceof \ViKon\Diff\Entry\DeletedEntry
            ? '-'
            : $entry->getNewPosition() + 1;

        echo ' - ';

        // Output line (entry)
        echo $entry;
    }
}
```

---

[Back to top](#diff-tool)

License
-------

[](#license)

This package is licensed under the MIT License

---

[Back to top](#diff-tool)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~157 days

Total

3

Last Release

3782d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.4.0

v1.0.2PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/97ac6badd847093e56369390bf36ddbb8740e10a8a495b339c2adb78e7345663?d=identicon)[vincekovacs](/maintainers/vincekovacs)

---

Top Contributors

[![vincekovacs](https://avatars.githubusercontent.com/u/1031595?v=4)](https://github.com/vincekovacs "vincekovacs (13 commits)")[![jdavidbakr](https://avatars.githubusercontent.com/u/25177?v=4)](https://github.com/jdavidbakr "jdavidbakr (1 commits)")

---

Tags

difflaravelcompare

### Embed Badge

![Health badge](/badges/vi-kon-laravel-diff/health.svg)

```
[![Health](https://phpackages.com/badges/vi-kon-laravel-diff/health.svg)](https://phpackages.com/packages/vi-kon-laravel-diff)
```

###  Alternatives

[stephenjude/filament-blog

Filament Blog Builder

20317.8k](/packages/stephenjude-filament-blog)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11229.2k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
