Skip to content

Commit

Permalink
Merge branch 'hotfix-2.0.3' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Feb 26, 2018
2 parents 3ae113d + 37499ad commit 064a1b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 10 additions & 13 deletions src/LaravelDesktopNotifierServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

/**
Expand Down

0 comments on commit 064a1b6

Please sign in to comment.