😄 This package assist you in getting started with emoji easily.
$ composer require overtrue/laravel-emoji
Laravel 5.5 auto-discovery supported.
If you are using < laravel 5.5
Overtrue\LaravelEmoji\EmojiServiceProvider::class,
'Emoji' => Overtrue\LaravelEmoji\Emoji::class,
Emoji::toImage(':smile:'); // <img class="emojione" alt="😄" title=":smile:" src="https://cdn.jsdelivr.net/emojione/assets/3.1/png/32/1f604.png"/>'
Emoji::toShort('😄'); // :smile:
Emoji::shortnameToUnicode(':smile:'); // 😄
// using helper
// default transform shorname to unicode, you can change it in config file.
emoji(':smile:'); // 😄
// access emoji services, return \Emojione\Client instance.
app('emoji');
// or
app(\Emojione\Client::class);
// config
$ php artisan vendor:publish --provider="Overtrue\\LaravelEmoji\\EmojiServiceProvider" --tag=config
// png images
$ php artisan vendor:publish --provider="Overtrue\\LaravelEmoji\\EmojiServiceProvider" --tag=public
// sprites images
$ php artisan vendor:publish --provider="Overtrue\\LaravelEmoji\\EmojiServiceProvider" --tag=sprites
MIT