2017 © Pedro Peláez
 

library php-ios-emoji

An iOS Emoji Parser For Laravel 5

image

euclid1990/php-ios-emoji

An iOS Emoji Parser For Laravel 5

  • Saturday, March 12, 2016
  • by euclid1990
  • Repository
  • 1 Watchers
  • 6 Stars
  • 512 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP iOS Emoji

Latest Stable Version Total Downloads License, (*1)

An iOS emoji parser for Laravel 5. cry, (*2)

Installation

PHP 5.5+ and Laravel 5 are required., (*3)

The PHP iOs Emoji Service Provider can be installed via Composer by requiring the euclid1990/php-ios-emoji package in your project's composer.json., (*4)

{
    "require": {
        "laravel/framework": "5.*",
        "euclid1990/php-ios-emoji": "~1.0"
    },
    "minimum-stability": "stable"
}

or, (*5)

Require this package with composer:, (*6)

composer require euclid1990/php-ios-emoji

Update your packages with composer update or install with composer install., (*7)

Setup

Bootstrap

To use the Emoji Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this., (*8)

Find the providers key in config/app.php and register the Emoji Service Provider., (*9)

    'providers' => [
        // ...
        'euclid1990\PhpIosEmoji\Providers\EmojiServiceProvider',
    ]

for Laravel 5.1+, (*10)

    'providers' => [
        // ...
        euclid1990\PhpIosEmoji\Providers\EmojiServiceProvider::class,
    ]

Find the aliases key in config/app.php., (*11)

    'aliases' => [
        // ...
        'Emoji' => 'euclid1990\PhpIosEmoji\Facades\Emoji',
    ]

for Laravel 5.1+, (*12)

    'aliases' => [
        // ...
        'Emoji' => euclid1990\PhpIosEmoji\Facades\Emoji::class,
    ]

Public Assets

Run following command: It will move all emotion icon images and style.css file to /public/ios-emoji., (*13)

php artisan vendor:publish --tag=public --force

Add Stylesheet

Add the style sheet we prepared for you., (*14)

<link rel="stylesheet" href="{{ asset('/ios-emoji/css/style.css') }}">

Or use helper:, (*15)

<link rel="stylesheet" href="{{ ios_emoji_css() }}">

Usage

1. Example:

\Emoji::parse($text);
<!DOCTYPE html>
<html>
<head>
    <title>PHP iOS Emoji</title>
    <link rel="stylesheet" href="{{ ios_emoji_css() }}">
</head>
<body>
    <p>'Parse the emotions: :smiley: :smile: :baby: :blush: :relaxed: :wink: :heart_eyes: :kissing_heart: in this string.'</p>
    <p>           ↓           </p>
    <p>{!! \Emoji::parse('Parse the emotions: :smiley: :smile: :baby: :blush: :relaxed: :wink: :heart_eyes: :kissing_heart: in this string.') !!}</p>
</body>
</html>

Result:, (*16)

Preview, (*17)

2. Use Helper:

$text = "Parse the emotions: :smiley: :smile: in this string.";
// iOS Emoji Parser
ios_emoji($text);

Reference

  1. Emoji Alias

The Versions

12/03 2016

dev-master

9999999-dev

An iOS Emoji Parser For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Vuong

12/03 2016

1.0.0

1.0.0.0

An iOS Emoji Parser For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Vuong