KaveNegar / kavenegar-laravel-notification by bgsrb

laravel notificatiion channel for Kavenegar
24,380
11
3
Package Data
Maintainer Username: bgsrb
Maintainer Contact: support@kavenegar.com (Kavenegar API Team)
Package Create Date: 2017-02-28
Package Last Update: 2019-03-01
Language: PHP
License: MIT
Last Refreshed: 2024-04-18 03:00:47
Package Statistics
Total Downloads: 24,380
Monthly Downloads: 695
Daily Downloads: 15
Total Stars: 11
Total Watchers: 3
Total Forks: 4
Total Open Issues: 2

Kavenegar notifications channel for Laravel 5.3 | 5.4

This package makes it easy to send Kavenegar SMS notifications with Laravel 5.3 or 5.4.

Contents

Installation

You can install the package via composer:

composer require kavenegar/laravel-notification

You must install the service provider:

// config/app.php
'providers' => [
    ...
    Kavenegar\LaravelNotification\KavenegarServiceProvider::class,
],

Setting up your Kavenegar account

Add your Kavenegar Account Key and Sender Number (optional) to your config/services.php:

// config/services.php
...
'kavenegar' => [
    'key' => env('KAVENEGAR_API_KEY'),
    'sender' => env('KAVENEGAR_SENDER')
],
...

Usage

Now you can use the channel in your via() method inside the notification:

use Kavenegar\LaravelNotification\KavenegarChannel;
use Illuminate\Notifications\Notification;

class HappyNewYear extends Notification
{
    public function via($notifiable)
    {
        return [KavenegarChannel::class];
    }

    public function toSMS($notifiable)
    {
        return 'Happy new year :D';
    }
}

In order to let your Notification know which phone number you are sending to, add the routeNotificationForSms method to your Notifiable model e.g your User Model

public function routeNotificationForSms()
{
    return $this->phone; // where `phone` is a field in your users table;
}

Contributing

Bug fixes, docs, and enhancements welcome! Please let us know support@kavenegar.com

راهنما

معرفی سرویس کاوه نگار

کاوه نگار یک وب سرویس ارسال و دریافت پیامک و تماس صوتی است که به راحتی میتوانید از آن استفاده نمایید.

ساخت حساب کاربری

اگر در وب سرویس کاوه نگار عضو نیستید میتوانید از لینک عضویت ثبت نام و اکانت آزمایشی برای تست API دریافت نمایید.

مستندات

برای مشاهده اطلاعات کامل مستندات وب سرویس پیامک به صفحه مستندات وب سرویس مراجعه نمایید.

راهنمای فارسی

در صورتی که مایل هستید راهنمای فارسی کیت توسعه کاوه نگار را مطالعه کنید به صفحه کد ارسال پیامک مراجعه نمایید.

اطالاعات بیشتر

برای مطالعه بیشتر به صفحه معرفی وب سرویس اس ام اس کاوه نگار مراجعه نمایید .

اگر در استفاده از کیت های سرویس کاوه نگار مشکلی یا پیشنهادی داشتید ما را با یک Pull Request یا ارسال ایمیل به support@kavenegar.com خوشحال کنید.

http://kavenegar.com

http://kavenegar.com