- Does alt-three/emoji work with Laravel 10 or Laravel 11?
- Not out of the box. Alt Three Emoji was built for Laravel 5 and predates package auto-discovery, typed properties and PHP 8 strictness, so in a Laravel 10 or 11 codebase it reads as an artifact. The realistic path is forking the parser and mapping array into your own namespace rather than installing the package directly.
- How do I install alt-three/emoji with Composer?
- On a Laravel 5.x or 6.x application you run composer require alt-three/emoji, then register the service provider and facade alias. On modern stacks the command will likely fail platform resolution outright because the constraints were written before PHP 8 and Laravel 9. If you are on a current Laravel version, vendor or fork the parser instead of fighting those constraints.
- How do I convert emoji shortcodes to Unicode in Laravel with this package?
- The package registers a singleton parser behind a facade, so you call it from a controller, a formatter class or a Blade directive to translate shortcodes such as :smile: into Unicode characters. Architecturally it is a thin decorator over a shortcode-to-Unicode mapping table, not a full text pipeline. Decide up front whether you need bidirectional conversion or only render-time conversion before wiring it in.
- Is alt-three/emoji still maintained?
- No, the repository is archived. There is no CVE triage, no security response channel and no PHP 8.4 or Laravel 11 compatibility work, and that is a permanent condition rather than a backlog item. Treat the code as a reference implementation and plan to own and maintain anything you extract from it.
- What are the alternatives to alt-three/emoji for Laravel?
- For shortcode-to-Unicode conversion on modern Laravel, symfony/emoji's EmojiTransliterator is maintained and framework-adjacent. Alternatively you can wrap an emojibase JSON dataset in a small internal service such as App\Support\Emoji. Both are strictly better bets than reviving an archived Laravel 5 package.
- How do I render emoji as images instead of Unicode glyphs?
- The package integrates the Emoji One library, which is what makes image rendering possible: it swaps codepoints for image markup backed by Emoji One assets. Keep that substitution at the render layer and make sure the img markup is generated by your own code, never by passing user input through unescaped. Budget for hosting the assets yourself, since the bundled Emoji One snapshot is as old as the mapping data.
- Does it support newer emoji like ZWJ family sequences, skin tones and flags?
- No. The mapping data is frozen around 2018, so Emoji 12 through 16 shortcodes are simply absent. Multi-codepoint sequences such as ZWJ families, skin-tone modifiers, regional-indicator flags and subdivision flags are the most likely to be missing or mangled, and naive regex splitting can break grapheme clusters mid-sequence to produce corrupted output instead of a clean fallback. If you need current coverage, use a maintained dataset and add golden-file tests for those sequences.
- Can I use alt-three/emoji on PHP 8?
- Expect trouble. The code was written before PHP 8 and will likely trip deprecations around dynamic properties, ${var} interpolation and implicit nullable parameters. Run it once under your target PHP version before committing to a fork, and check the mapping array for era-specific helper calls such as each, array_get and the str_ functions.
- Should emoji conversion run before or after escaping user content?
- This is a decision to make explicitly rather than by accident, because both orderings carry hazards. Converting before escaping risks double-encoding or XSS, while converting after escaping risks rendering entities literally in the output. Pick a canonical stored form, store Unicode, accept both shortcodes and Unicode on input, and normalize at ingest.
- How should I migrate stored emoji shortcodes in my database?
- Backfill stored shortcodes only if they already exist in the database; otherwise normalize at the boundary and leave history alone, because retroactively rewriting user content is a product decision rather than an engineering one. Before any of that, migrate the column charset and collation to utf8mb4, planning online DDL for large tables and auditing index prefix lengths first. Then place the converter behind an interface so the forked parser can be swapped later without moving call sites.