james.xue / laravel-notification-channels
laravel notify channels
Fund package maintenance!
xiaoxuan6.github.io/images/donate/alipayimg.jpg
v1.2.1
2024-03-18 00:07 UTC
Requires
- php: ^8.0|^8.1|^8.2
- guzzlehttp/guzzle: ^7.5
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.19
- jetbrains/phpstorm-attributes: ^1.0
- laravel/framework: ^9.0 | ^10.0| ^11.0
- rector/rector: ^0.17.0 || ^0.18.0
README
Install
composer require james.xue/laravel-notification-channels
Publish Config
php artisan make:vendor publish --tag=laravel-notification-channels
Environment
Modify correspondence channel env
configuration
Usage
use Illuminate\Support\Facades\Notification; use Vinhson\LaravelNotifications\Notifications\DingTalkNotification; Notification::send($this, new DingTalkNotification($title, $message)); or Notification::send($this, new DingTalkNotification(message: $message));
class NotifyController extends Controller { use Notifiable; public function index() { $user = User::factory()->create(); $this->notify(new DingTalkNotification('通知', '【golang】姓名:' . $user->name . ' 邮箱:' . $user->email)); config()->set('laravel-notifications.ding_talk.send_type', 'markdown'); $data = "#### \n > golang】姓名:" . $user->name . " # 邮箱:" . $user->email; $this->notify(new DingTalkNotification('Markdown 通知', $data)); return 'ok'; } }