/eskiz

eskiz notification channel

Primary LanguagePHPMIT LicenseMIT

Eskiz.uz notifications channel for Laravel

Latest Version on Packagist Software License Build Status StyleCI SensioLabsInsight Quality Score Code Coverage Total Downloads

This package makes it easy to send notifications using [:service_name](link to service) with Laravel 5.5+, 6.x and 7.x

Note: Replace :channel_namespace :service_name :author_name :author_username :author_website :author_email :package_name :package_description :style_ci_id :sensio_labs_id with their correct values in README.md, CHANGELOG.md, CONTRIBUTING.md , LICENSE.md, composer.json and other files, then delete this line. Tip: Use "Find in Path/Files" in your code editor to find these keywords within the package directory and replace all occurences with your specified term.

This is where your description should go. Add a little code example so build can understand real quick how the package can be used. Try and limit it to a paragraph or two.

Contents

Installation

This package can be installed via composer:

composer require laravel-notification-channels/eskiz

Setting up the Eskiz service

  1. Create an account and get the API key here

  2. Add the API key to the services.php config file:

    // config/services.php
    ...
    'eskiz' => [
        'api_key' => env('ESKIZ_API_KEY'),
        'from'    => env('ESKIZ_NICKNAME'),
    ],
    ...

Usage

You can use this channel by adding SMS77Channel::class to the array in the via() method of your notification class. You need to add the toSms77() method which should return a new SMS77Message() object.

<?php

namespace App\Notifications;

use Illuminate\Notifications\Notification;
use NotificationChannels\Eskiz\EskizChannel;
use NotificationChannels\Eskiz\EskizMessage;

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

    public function toEskiz() {
        return new EskizMessage('Mendan senga salomlar bolsin megajin!');
    }
}

Available Message methods

  • getPayloadValue($key): Returns payload value for a given key.
  • content(string $message): Sets SMS message text.
  • to(string $number): Set recipients number.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.