diff --git a/README.md b/README.md index 691acb7..b3ae7f6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ An emoji parser for Laravel 5. To get the latest version of Alt Three Emoji, simply add the following line to the require block of your `composer.json` file: ``` -"alt-three/emoji": "~1.1" +"alt-three/emoji": "~1.2" ``` You'll then need to run `composer install` or `composer update` to download it and have the autoloader updated. diff --git a/composer.json b/composer.json index 29dc7ec..d3ee7dc 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,7 @@ "php": ">=5.5.9", "graham-campbell/markdown": "~4.0", "guzzlehttp/guzzle": "~5.3|~6.0", + "illuminate/contracts": "5.1.*", "illuminate/support": "5.1.*" }, "require-dev": { @@ -42,7 +43,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "minimum-stability": "dev", diff --git a/src/EmojiServiceProvider.php b/src/EmojiServiceProvider.php index e4f8973..c5e2710 100644 --- a/src/EmojiServiceProvider.php +++ b/src/EmojiServiceProvider.php @@ -11,7 +11,9 @@ namespace AltThree\Emoji; +use Exception; use GuzzleHttp\Client; +use Illuminate\Contracts\Debug\ExceptionHandler; use Illuminate\Support\ServiceProvider; use League\CommonMark\Environment; @@ -88,7 +90,12 @@ protected function registerEnvironment() $app = $this->app; $app->resolving('markdown.environment', function (Environment $environment) use ($app) { - $environment->addInlineParser($app['emoji']); + try { + $environment->addInlineParser($app['emoji']); + } catch (Exception $e) { + $app->make(ExceptionHandler::class)->report($e); + } + }); }