Download the PHP package andkab/laravel-joypixels without Composer
On this page you can find all versions of the php package andkab/laravel-joypixels. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andkab/laravel-joypixels
More information about andkab/laravel-joypixels
Files in andkab/laravel-joypixels
Package laravel-joypixels
Short Description Laravel helper for Joypixels, EmojiOne
License MIT
Homepage https://github.com/andkab/laravel-joypixels
Informations about the package laravel-joypixels
laravel-joypixels
Laravel package to make it easier working with the gorgeous emojis from Joypixels.
Remember to read the Joypixels Free License and provide the appropriate attribution. Or buy a premium license
installation
Via Composer
Usage
Blade (equivalent to LaravelJoyPixels::toImage($str)
):
@joypixels(':smile:')
->
@joypixels(':smile: ❤️')
->
🚨 The output is not escaped so be careful with what you pass into @joypixels
.
More details about how toImage($str)
works can be found at https://github.com/Ranks/emojione/blob/master/examples/PHP.md
Example
You want to let users put emoji a comment.
When you are saving a comment, you might want to run the content through LaravelJoyPixels::toShort($str)
to convert 😄
and other emoji to :smile:
etc.
So if someone leaves a comment like This is an awesome comment 😄🔥
it will be saved as This is an awesome comment :smile: :fire:
In your view where you display your comments you can use
and that will convert :smile:
and 😄
to the emojione equivalent.
Assets
By default it will use the assets from JSDelivr.
Remember to run this before trying to publish any of the assets:
If you want to serve the assets yourself you can publish them with the following commands. Remember to update config/joypixels.php
PNG files in sizes 32/64/128:
In config/joypixels.php
specify the local path. Remember to specify which size you want in the path (32/64/128).
Sprites
If you want to use sprites:
In config/joypixels.php
enable sprites:
Add the stylesheet to your HTML:
License
Remember to read the Joypixels Free License and provide the appropriate attribution. Or buy a premium license