spatie / emoji Goto Github PK
View Code? Open in Web Editor NEWProgramatically work with emoji characters
Home Page: https://freek.dev/376-using-emoji-in-php
License: MIT License
Programatically work with emoji characters
Home Page: https://freek.dev/376-using-emoji-in-php
License: MIT License
It would be great if this package update its support to Laravel 8!
I am using Laravel 8 and attempting to use a accessor to pull an icon (something like "CHARACTER_GRINNING_FACE") from the database and provide the icon.
My desire is to handle this through the eloquent model.
When I tested getting an emoji (not dynamically) the icon is provided as expected.
dd(\Spatie\Emoji\Emoji::CHARACTER_GRINNING_FACE);
However when I attempt to add an accessor to my model I get an UnknownCharacter exception.
I have attempted to use the getCharacter()
method on the emoji class, with no success.
The value passed into the accessor in this example is CHARACTER_GRINNING_FACE
public function getIconAttribute($value)
{
return Emoji::getCharacter($value);
}
I have also attempted to call the Emoji class as shown below, with no success.
public function getIconAttribute($value)
{
return call_user_func('\Spatie\Emoji\Emoji::'.$value);
}
The error I get each time is the following.
Spatie\Emoji\Exceptions\UnknownCharacter
Character CHARACTER_GRINNING_FACE
does not exist
Any advice you might have for getting the emoji character dynamically based on data in a database would be greatly appreciated.
/**
* @method static string 1stPlaceMedal()
* @method static string 2ndPlaceMedal()
* @method static string 3rdPlaceMedal()
*/
They should be converted to first
, second
, third
or prefixed with anything.
http://unicode.org/emoji/charts/full-emoji-list.html
http://unicode.org/emoji/charts/index.html#col-code
Some rows have more than one codepoint where a sequence is required, such as for flags and keycaps.
echo Emoji::flagForBelgium();
So the previous code doesn't display the flag correctly, as it stores just the first codepoint for the flag U+1F1E7
, that applies for all flags and keycaps. Any planned fix?
Hello,
I installed spatie/emoji into my laravel 8 app on my local Kubuntu 18 and wonder if these emojis
are dependable from other packages/fonts/Browsers of the OS?
I found a hint that I need fonts-noto-color-emoji to be installed in the OS...
Thanks!
https://unicode.org/Public/emoji/12.0/emoji-test.txt
Using the generator #32 it should be easy to upgrade to Unicode Emoji v12 - but to make this work #32 should be merged.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.