diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cdd354..b082692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.0.3] - 2018-02-26 +### Added +- Fixes `Undefined property` on macro + ## [2.0.0] - 2018-02-16 ### Added - Support to Laravel 5.6 diff --git a/src/LaravelDesktopNotifierServiceProvider.php b/src/LaravelDesktopNotifierServiceProvider.php index b75dd7d..fc7c630 100644 --- a/src/LaravelDesktopNotifierServiceProvider.php +++ b/src/LaravelDesktopNotifierServiceProvider.php @@ -36,22 +36,19 @@ public function boot() * * @return void */ - Command::macro( - 'notify', - function (string $text, string $body, $icon = null) { - $notifier = $this->app[Contracts\Notifier::class]; + Command::macro('notify', function (string $text, string $body, $icon = null) { + $notifier = $this->laravel[Contracts\Notifier::class]; - $notification = $this->app[Contracts\Notification::class] - ->setTitle($text) - ->setBody($body); + $notification = $this->laravel[Contracts\Notification::class] + ->setTitle($text) + ->setBody($body); - if (! empty($icon)) { - $notification->setIcon($icon); - } - - $notifier->send($notification); + if (! empty($icon)) { + $notification->setIcon($icon); } - ); + + $notifier->send($notification); + }); } /**