90

GitHub - overtrue/laravel-emoji: This package assist you in getting started with...

 6 years ago
source link: https://github.com/overtrue/laravel-emoji
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Laravel Emoji

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

Installing

$ composer require overtrue/laravel-emoji

Laravel 5.5 auto-discovery supported.

If you are using < laravel 5.5

Add service provider

Overtrue\LaravelEmoji\EmojiServiceProvider::class,

Add alias

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

Usage

Emoji::toImage(':smile:'); // <img class="emojione" alt="&#x1f604;" 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);

Configurations && emoji images

// 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

License

MIT


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK