christofferok / laravel-emojione Goto Github PK
View Code? Open in Web Editor NEWLaravel package to make it easy to use the gorgeous emojis from EmojiOne
License: MIT License
Laravel package to make it easy to use the gorgeous emojis from EmojiOne
License: MIT License
Hey, I was wondering if I could submit a pull request to bring the ascii config option across?
I would like to do the conversion below to insert the values into shortname in the database.
LaravelEmojiOne::imageToShortname($str);
But how to do that?
I'd like some help.
Thanks.
I really find it strange since package is working perfectly in local server. After pushing changes to server emojis are not parsed on server.
namespace App\Transformers;
use App\Models\Post;
use League\Fractal\TransformerAbstract;
use ChristofferOK\LaravelEmojiOne\LaravelEmojiOneFacade;
class FeedPostTransformer extends TransformerAbstract
{
/**
* A Fractal transformer.
*
* @return array
*/
public function transform(Post $post)
{
return [
'description' => LaravelEmojiOneFacade::toImage($post->body)
];
}
}
This is the code i use for parsing emojis. Actually using spatie/fractal wrapper for returning data.
Same request, first made on server and second made locally. I update composer on server, also cleared cache but cant get it working. Tested parsing emoji with tinker and works. Maybe it is fractal issue?
Can you push a update so any of us using your great package can get the latest and greatest emojis?
Are you planing to support PHP 8 in the near future? Currently getting christofferok/laravel-emojione[4.0.0, ..., 4.0.4] require php ~5.6|~7.0 -> your php version (8.0.5) does not satisfy that requirement.
when trying to update composer.
I want to add a button like facebook or other lots of sites are doing first they are printing all emojis and then they are using pick one by one in message or there comment.
@christofferok could you please make the quick update?
Upon installing this does this mean I can just type :s m i l i e: in my textarea on my app for comments and it will automatically show as ๐ when posted? Im new to laravel so please excuse my noobness.
<!-- Add comment -->
<div class="col-md-12">
{!! Form::open(array('route' => array('comment_torrent', 'slug' => $torrent->slug, 'id' => $torrent->id))) !!}
<div class="form-group">
<label for="content">Your comment:</label>
<textarea name="content" cols="30" rows="5" class="form-control"></textarea>
</div>
<button type="submit" class="btn btn-danger">{!! trans('traduction.save') !!}</button><label class="checkbox-inline"><input type="checkbox" name="confirmation"><strong>Anonymous Comment</strong></label>
{!! Form::close() !!}
</div>
<!-- /Add comment -->
Hi,
I'm on laravel 5.2,
when using @emojione($text)
in blade, it shows an error with the title Call to undefined function resolve()
and I fixed it by changing line 24 in LaravelEmojiOneServiceProvider.php file from:
return "<?php echo resolve('".LaravelEmojiOne::class."')->toImage($expression); ?>";
to
return "<?php echo \LaravelEmojiOne::toImage($expression); ?>";
Fixed by #22
Description:
emojione v3.1.3 breaks this package returning Undefined variable: shortname
v3.1.2 returns before trying to access the $shortname var
$ruleset = $this->getRuleset();
$shortcode_replace = $ruleset->getShortcodeReplace();
$unicode_replace = $ruleset->getUnicodeReplace();
$unicode_replace_greedy = $ruleset->getUnicodeReplaceGreedy();
$unicode = strtoupper($m[0]);
if ( array_key_exists($unicode, $unicode_replace))
{
$shortname = $unicode_replace[$unicode];
}
else if ( $this->greedyMatch && array_key_exists($unicode, $unicode_replace_greedy) )
{
$shortname = $unicode_replace_greedy[$unicode];
}
else
{
return $m[0]; // <-- returns here
}
$filename = $shortcode_replace[$shortname][2];
$category = (strpos($filename, '-1f3f') !== false) ? 'diversity' : $shortcode_replace[$shortname][3];
$titleTag = $this->imageTitleTag ? 'title="'.htmlspecialchars($shortname).'"' : '';
https://github.com/emojione/emojione/blob/3.1.2/lib/php/src/Client.php#L466
v3.1.3 no longer returns before setting the $shortname
if ( array_key_exists($unicode, $unicode_replace) && !in_array($unicode, $bList) )
{
$shortname = $unicode_replace[$unicode];
}
else if ( $this->greedyMatch && array_key_exists($unicode, $unicode_replace_greedy) && !in_array($unicode, $bList) )
{
$shortname = $unicode_replace_greedy[$unicode];
}
else
{
$unicode; // <-- Gets to this point
}
$filename = $shortcode_replace[$shortname][2]; // <-- shortname is not set
$category = (strpos($filename, '-1f3f') !== false) ? 'diversity' : $shortcode_replace[$shortname][3];
$titleTag = $this->imageTitleTag ? 'title="'.htmlspecialchars($shortname).'"' : '';
https://github.com/emojione/emojione/blob/3.1.3/lib/php/src/Client.php#L469
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.