- How do I install overtrue/laravel-emoji in a Laravel app?
- Install it with composer require overtrue/laravel-emoji. Laravel package discovery registers the service provider automatically, then publish the config file with vendor:publish using the provider or tag documented in the README. No migrations or schema changes are involved.
- Which Laravel and PHP versions does overtrue/laravel-emoji support?
- Version 3.0.0 requires PHP 8.3 or newer and Laravel 13, while older Laravel releases should stay on the 2.x line. There is no polyfill or graceful degradation for that platform floor, so upgrade sequencing matters. Check the Composer constraints before adding it to a Laravel 10, 11, or 12 application.
- How do I render emoji from shortcodes in a Blade template?
- Use the @emoji Blade directive with the text you want converted, or call the global emoji() helper inside Blade echo tags. The facade exposes the same conversion pipeline for code outside templates. All three surfaces are thin wrappers around the underlying overtrue/emoji library.
- Does laravel-emoji output unicode emoji or image tags?
- The output depends on the configured driver and the underlying library. Image-oriented drivers such as JoyPixels return HTML markup pointing at emoji assets, while native or unicode mode returns the emoji character itself. Choose based on whether you need consistent glyphs in email, PDFs, or legacy clients.
- Can I use the emoji() helper in models, jobs, or API responses?
- Yes, emoji() is a global helper and the facade is available anywhere the Laravel container is booted, including models, jobs, and API resources. Remember that it may return rendered markup, so JSON APIs should decide whether to return HTML, plain unicode, or a separate field. Avoid mixing markup into contexts where clients expect plain text.
- Is laravel-emoji output safe for user-generated content and XSS?
- The helper converts text into HTML, so treat it as a rendering boundary and verify that escaping behavior matches your use case. For user-generated content, prefer native unicode output or sanitize and escape input and output before injecting it into Blade. Do not assume the package alone makes arbitrary user HTML safe; review the config and test with hostile input.
- What are the JoyPixels licensing requirements for laravel-emoji?
- The underlying library historically used Emojione and now uses JoyPixels assets. JoyPixels carries its own license terms, including a free tier with attribution obligations and paid commercial licensing for some uses. If you emit CDN-hosted images in a commercial product, get legal sign-off and confirm attribution requirements.
- Can I self-host emoji assets or avoid the third-party CDN?
- If your chosen driver supports it, publish the config and point asset URLs at locally hosted emoji files instead of a remote CDN. The native unicode driver avoids remote assets entirely, which also removes external availability and privacy concerns. Confirm the exact driver options in the README for your package version.
- How do I test emoji conversion in a Laravel application?
- Test the helper and Blade directive through normal Laravel HTTP or view tests, asserting the exact output your chosen driver produces. Facade swapping or container binding can isolate the converter when you need deterministic markup. The package's own test suite is small, so add regression cases for shortcodes, unicode input, and escaping.
- Is overtrue/laravel-emoji maintained, and what are the alternatives?
- It is a small, single-maintainer wrapper around overtrue/emoji with a limited test suite, so treat it as replaceable rather than critical infrastructure. Alternatives include rendering emoji client-side, using the underlying emoji library directly, or writing a short in-house Blade helper. If it is abandoned, the wrapper is small enough to fork or replace.