tylercd100 / laravel-notify
Installs: 149 086
Dependents: 1
Suggesters: 0
Security: 0
Stars: 11
Watchers: 3
Forks: 5
Open Issues: 2
Requires
- php: ^7.2|^8.0
- illuminate/support: ^6.0|^7.0|^8.0
- monolog/monolog: ^2.0
- psr/log: ^1.0
- tylercd100/monolog-mailgun: ^3.0
- tylercd100/monolog-sms: ^2.0
Requires (Dev)
- http-interop/http-factory-guzzle: ^1.0.0
- mockery/mockery: ~1.3.3|^1.4.2
- orchestra/testbench: ^4.0|^5.0|^6.0
- php-http/guzzle7-adapter: ^0.2.0
- phpunit/phpunit: ^8.4|^9.3.3
- sentry/sentry: dev-php8-support
- symfony/options-resolver: ^5.1
Suggests
- sentry/sentry: Required to use the Sentry driver (~3.0).
This package is auto-updated.
Last update: 2024-10-17 13:27:57 UTC
README
Laravel Notify is a Laravel 5 package that will let you send notification messages to various services.
Currently supported notification channels via Monolog
- Pushover
- Slack
- Fleephook
- Flowdock
- Plivo an SMS messaging service.
- Twilio an SMS messaging service.
- Sentry via Sentry SDK for PHP
- Mailgun
Version Compatibility
Installation
Version 2.x uses Package Discovery. If you are using 1.x you will need to follow these instructions.
Install via composer - In the terminal:
composer require tylercd100/laravel-notify
Then you will need to run this in order to copy the config file.
php artisan vendor:publish --provider="Tylercd100\Notify\Providers\NotifyServiceProvider"
Usage
After you have changed your configuration file (config/notify.php
) you can simply use it like so:
Notify::debug("This is a debug message!"); Notify::info("This is a info message!"); Notify::notice("This is a notice message!"); Notify::warning("This is a warning message!"); Notify::error("This is a error message!"); Notify::critical("This is a critical message!"); Notify::alert("This is a alert message!"); Notify::emergency("This is a emergency message!"); # Add context Notify::info("This is a info message with context!",['user'=>$user, 'data'=>$data]);
Other Features
Laravel Notify also exposes extra Facades. To use them you will need to add them to your config/app.php
file in your aliases array.
"Pushover" => Tylercd100\Notify\Facades\Pushover::class, "Flowdock" => Tylercd100\Notify\Facades\Flowdock::class, "FleepHook" => Tylercd100\Notify\Facades\FleepHook::class, "Slack" => Tylercd100\Notify\Facades\Slack::class, "Plivo" => Tylercd100\Notify\Facades\Plivo::class, "Twilio" => Tylercd100\Notify\Facades\Twilio::class, "Sentry" => Tylercd100\Notify\Facades\Sentry::class, "Mailgun" => Tylercd100\Notify\Facades\Mailgun::class,
And then use them like this
Slack::info("This is information!"); Pushover::critical("Everything is broken and the server room caught fire!");