Coder Social home page Coder Social logo

emoji's Issues

Laravel 8 Support

It would be great if this package update its support to Laravel 8!

Calling for Emoji Dynamically

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 names starting with a number are invalid

/**
 * @method static string 1stPlaceMedal()
 * @method static string 2ndPlaceMedal()
 * @method static string 3rdPlaceMedal()
 */

They should be converted to first, second, third or prefixed with anything.

Flags in Chrome

It seems that flag emojis are not showing in Chrome (using 86.0.4240.198). Firefox is ok.

image

Euro
{!! \Spatie\Emoji\Emoji::countryFlag('be') !!}
{!! \Spatie\Emoji\Emoji::grinningFace() !!}

What could be the reason? Am I missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.