diff --git a/composer.json b/composer.json index 7c66e3a..5a21d0e 100644 --- a/composer.json +++ b/composer.json @@ -4,13 +4,14 @@ "keywords": ["laravel", "framework", "console", "artisan", "php", "wrapper", "JoliNotif", "notification", "notifier", "Nuno Maduro", "NunoMaduro"], "license": "MIT", "require": { - "php": ">=5.5.9", - "illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*", - "jolicode/jolinotif": "^1.1" + "php": "^7.1.3", + "illuminate/support": "5.6.*", + "illuminate/console": "5.6.*", + "jolicode/jolinotif": "2.0.*" }, "require-dev": { - "graham-campbell/testbench": "^3.1", - "phpunit/phpunit": "^4.8|^5.0" + "graham-campbell/testbench": "dev-master", + "phpunit/phpunit": "^7.0" }, "authors": [ { diff --git a/readme.md b/readme.md index d542b5c..c1c437a 100644 --- a/readme.md +++ b/readme.md @@ -1,48 +1,35 @@ -
- -Laravel Desktop Notifier -================ - -Laravel Desktop Notifier was created by, and is maintained by [Nuno Maduro](https://github.com/nunomaduro), and is a [JoliNotif](https://github.com/jolicode/JoliNotif) wrapper for [Laravel](http://laravel.com). Feel free to check out the [change log](CHANGELOG.md), [releases](nunomaduro/laravel-desktop-notifier/releases), [license](LICENSE), and [contribution guidelines](CONTRIBUTING.md). ++ +
-## Installation +## About Laravel Desktop Notifier -[PHP](https://php.net) 5.5+ +Laravel Desktop Notifier was created by, and is maintained by [Nuno Maduro](https://github.com/nunomaduro), and is a replacement for the List Command in Laravel Console Commands. -To get the latest version of Laravel Desktop Notifier, simply require the project using [Composer](https://getcomposer.org): +## Installation -```bash -$ composer require nunomaduro/laravel-desktop-notifier -``` +> **Requires [PHP 7.1+](https://php.net/releases/)** -Instead, you may of course manually update your require block and run `composer update` if you so choose: +Require Laravel Desktop Notifier using [Composer](https://getcomposer.org): -```json -{ - "require": { - "nunomaduro/laravel-desktop-notifier": "^1.0" - } -} +```bash +composer require nunomaduro/laravel-desktop-notifier ``` -## Usage with Trait +## Usage ```php -use Illuminate\Console\Command; -use NunoMaduro\LaravelDesktopNotifier\Notifications; -class Zonda extends Command +class ZondaCommand extends Command { - use Notifications; - public function handle() { $this->notify('Hello Web Artisan', 'Love beautiful code? We do too!'); @@ -50,42 +37,17 @@ class Zonda extends Command } ``` -## Usage with Laravel IOC container - -```php -use Illuminate\Console\Command; -use NunoMaduro\LaravelDesktopNotifier\Contracts\Notifier; -use NunoMaduro\LaravelDesktopNotifier\Contracts\Notification; - -class Zonda extends Command -{ - public function handle() - { - $notifier = app(Notifier::class); - - $notification = app(Notification::class) - ->setTitle('Hello Web Artisan') - ->setBody('Love beautiful code? We do too!') - ->setIcon(__DIR__ . '/path/to/your/icon.png'); - - $notifier->send($notification); - } -} -``` - -## Git branching model - -The git branching model used for development is the one described and assisted by `twgit` tool: [https://github.com/Twenga/twgit](https://github.com/Twenga/twgit). - -## Stay In Touch - -For latest releases and announcements, follow on Twitter: [@enunomaduro](https://twitter.com/enunomaduro) - ## Contributing Thank you for considering to contribute to Laravel Desktop Notifier. All the contribution guidelines are mentioned [here](CONTRIBUTING.md). -You can have a look at the [CHANGELOG](CHANGELOG.md) for constant updates & detailed information about the changes. You can also follow the twitter account for latest announcements: [@enunomaduro](https://twitter.com/enunomaduro) +You can have a look at the [CHANGELOG](CHANGELOG.md) for constant updates & detailed information about the changes. You can also follow the twitter account for latest announcements or just come say hi!: [@enunomaduro](https://twitter.com/enunomaduro) + +## Support the development +**Do you like this project? Support it by donating** + +- PayPal: [Donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L) +- Patreon: [Donate](https://www.patreon.com/nunomaduro) ## License diff --git a/src/Contracts/Notification.php b/src/Contracts/Notification.php index 38921d4..aea4419 100644 --- a/src/Contracts/Notification.php +++ b/src/Contracts/Notification.php @@ -28,7 +28,7 @@ public function getTitle(); * * @return \NunoMaduro\LaravelDesktopNotifier\Contracts\Notification */ - public function setTitle($title); + public function setTitle(string $title): \Joli\JoliNotif\Notification; /** * @return string @@ -40,7 +40,7 @@ public function getBody(); * * @return \NunoMaduro\LaravelDesktopNotifier\Contracts\Notification */ - public function setBody($body); + public function setBody(string $body): \Joli\JoliNotif\Notification; /** * @return string @@ -52,5 +52,5 @@ public function getIcon(); * * @return \NunoMaduro\LaravelDesktopNotifier\Contracts\Notification */ - public function setIcon($icon); + public function setIcon(string $icon): \Joli\JoliNotif\Notification; } diff --git a/src/LaravelDesktopNotifierServiceProvider.php b/src/LaravelDesktopNotifierServiceProvider.php index 9ef4205..6318cc7 100644 --- a/src/LaravelDesktopNotifierServiceProvider.php +++ b/src/LaravelDesktopNotifierServiceProvider.php @@ -11,22 +11,48 @@ namespace NunoMaduro\LaravelDesktopNotifier; -use Illuminate\Support\ServiceProvider; use Joli\JoliNotif\NotifierFactory; -use NunoMaduro\LaravelDesktopNotifier\Contracts\Notification as NotificationContract; +use Illuminate\Console\Command; +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. - * - * @author Nuno Maduro