PHPackages                             devopdan/uniji - 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. devopdan/uniji

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

devopdan/uniji
==============

A Laravel package for handling Emoji's in Unicode (UTF8/16BE/Surrogate Pairs)

10PHP

Since Jun 27Pushed 1y agoCompare

[ Source](https://github.com/DevOpDan/Uniji)[ Packagist](https://packagist.org/packages/devopdan/uniji)[ RSS](/packages/devopdan-uniji/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Uniji
=====

[](#uniji)

A Laravel Package to handle Unicode and HTML entity Emoji's.

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

[](#installation)

```
composer require devopdan/uniji
```

Caching the Library
-------------------

[](#caching-the-library)

You can pre-cache the library by running the following command:

```
php artisan uniji:cache
```

**Note:** *There are little over 4000 emojis in the library. Cache them...*

If needed, you can clear the cache with the following command:

```
php artisan uniji:clear
```

Usage
-----

[](#usage)

Import the Uniji facade

```
use DevOpDan\Uniji\Facades\Uniji;
```

Depending on your needs, you can use the following methods:

```
// For a single emoji
Uniji::render(':heart:', 'unicode'); // Output: ❤️
Uniji::render(':heart:', 'html'); // Output: ❤️

// Defaults to html format, if no format is specified
Uniji::render(':heart:'); // Output: ❤️
```

If you're working with a paragraph of text, you can use the following method:

```
// Our paragraph with :shortcodes: in it.
$paragraph = "This package was made with :heart: by DevOpDan";

$paragraph = Uniji::convertShortcodesInParagraphsToUnicode($paragraph)
// Output: This package was made with ❤️ by DevOpDan

$paragraph = Uniji::convertShortcodesInParagraphsToHtml($paragraph)
// Output: This package was made with ❤️ by DevOpDan
```

For convenience, two Macros have been provided to the Stringable class to make it easier to convert shortcodes to their unicode or html versions.

```
$bio = Str::of($user->bio)->shortcodesToUnicode();
$bio = Str::of($user->bio)->shortcodesToHtml();
```

**Gotcha!** - Keep in mind the Shortcodes are case-sensitive, so it is advisable to run `shortcodesToUnicode` and `shortcodesToHtml` before chaining the macros.

This would fail for instance

```
// Assuming that $article->headline = "I :heart: Laravel"

$result = Str::of($article->headline)->title()->shortcodesToHtml();
// Output: I :Heart: Laravel

$result = Str::of($article->headline)->shortcodesToHtml()->title();
// Output: I ❤️ Laravel
```

Blade
-----

[](#blade)

If you're using Blade, you can use the following syntax:

```
I @uniji(':heart:') Laravel // Output: I ❤️ Laravel
```

You may also use `@unijiunicode()` should you require Unicode output via blade.

Closing
-------

[](#closing)

Internally, when converting the shortcodes to their Html or Unicode counterpart, you will see the same output. It's just a matter of the format you're using.

For instance, if you check the source of the output in your browser, you will actually see: `&#X2764`; (Html) or `❤` (Unicode).

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5ac5166896f5ab35de88c53bb23c8d131bb07e129120ca9d299dc37469fd262?d=identicon)[DevOpDan](/maintainers/DevOpDan)

---

Top Contributors

[![DevOpDan](https://avatars.githubusercontent.com/u/27520934?v=4)](https://github.com/DevOpDan "DevOpDan (1 commits)")

### Embed Badge

![Health badge](/badges/devopdan-uniji/health.svg)

```
[![Health](https://phpackages.com/badges/devopdan-uniji/health.svg)](https://phpackages.com/packages/devopdan-uniji)
```

PHPackages © 2026

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