james.xue/laravel-notification-channels

v1.2.1 2024-03-18 00:07 UTC

This package is auto-updated.

Last update: 2024-11-05 23:27:05 UTC


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';
    }
}

Support Channel