Skip to content

Commit

Permalink
Merge branch 'release-1.2.0' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Jul 21, 2017
2 parents c6ad9d7 + 07effe7 commit 5fcafac
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ 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/).

## [1.0.0] - 2017-06-18
## [1.2.0] - 2017-07-22
### Added
- First release
- Adds Notifier Facade

## [1.1.2] - 2017-06-27
### Fixed
- Fixed service provider namespace on readme ([#4](https://github.com/nunomaduro/laravel-desktop-notifier/pull/4))

## [1.0.0] - 2017-06-18
### Added
- First release
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
"laravel": {
"providers": [
"NunoMaduro\\LaravelDesktopNotifier\\LaravelDesktopNotifierServiceProvider"
]
],
"aliases": {
"Notifier": "NunoMaduro\\LaravelDesktopNotifier\\Facaces\\Notifier"
}
}
},
"minimum-stability": "dev",
Expand Down
32 changes: 32 additions & 0 deletions src/Facades/Notifier.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

/**
* This file is part of Laravel Desktop Notifier.
*
* (c) Nuno Maduro <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace NunoMaduro\LaravelDesktopNotifier\Facades;

use Illuminate\Support\Facades\Facade;

/**
* The is the Laravel Desktop Notifier facade class.
*
* @author Nuno Maduro <[email protected]>
*/
class Notifier extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'desktop.notifier';
}
}
12 changes: 8 additions & 4 deletions src/LaravelDesktopNotifierServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace NunoMaduro\LaravelDesktopNotifier;

use Illuminate\Support\ServiceProvider;
use Joli\JoliNotif\NotifierFactory;
use NunoMaduro\LaravelDesktopNotifier\Contracts\Notification as NotificationContract;
use Illuminate\Support\ServiceProvider;
use NunoMaduro\LaravelDesktopNotifier\Contracts\Notifier as NotifierContract;
use NunoMaduro\LaravelDesktopNotifier\Contracts\Notification as NotificationContract;

/**
* The is the Laravel Desktop Notifier service provider class.
Expand All @@ -30,16 +30,20 @@ class LaravelDesktopNotifierServiceProvider extends ServiceProvider
*/
public function register()
{
$this->app->singleton(NotifierContract::class, function ($app) {
$this->app->singleton('desktop.notifier', function ($app) {
$config = $app['config']['app.notifiers'];

$notifier = NotifierFactory::create(is_array($config) ? $config : []);

return new Notifier($notifier);
});

$this->app->bind(NotificationContract::class, function () {
$this->app->alias('desktop.notifier', NotifierContract::class);

$this->app->bind('desktop.notification', function () {
return new Notification();
});

$this->app->alias('desktop.notification', NotificationContract::class);
}
}

0 comments on commit 5fcafac

Please sign in to comment.