Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.05 KB

README.md

File metadata and controls

53 lines (36 loc) · 1.05 KB

Laravel Emoji

😄 This package assist you in getting started with emoji easily.

Installing

$ composer require xuejd3/laravel-emoji

Laravel auto-discovery supported.

If you are using < laravel 5.5

Add service provider

Xuejd3\LaravelEmoji\EmojiServiceProvider::class,

Add alias

'Emoji' => Xuejd3\LaravelEmoji\Emoji::class,

Usage

Emoji::toImage(':smile:'); // <img class="joypixels" alt="&#x1f604;" title=":smile:" src="https://cdn.jsdelivr.net/joypixels/assets/5.0/png/unicode/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 \JoyPixels\Client instance.
app('emoji');
// or 
app(\JoyPixels\Client::class);

Configurations

// config
$ php artisan vendor:publish --provider="Xuejd3\\LaravelEmoji\\EmojiServiceProvider"

License

MIT