Skip to content

پکیج لاراولی (6+) ارسال اس ام اس سازگار با نوتیفیکیشن برای آپی پنل

License

Notifications You must be signed in to change notification settings

mlk9/ippanel-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IPPanel Laravel

پکیج لاراولی ارسال اس ام اس سازگار با نوتیفیکیشن برای آپی پنل

نیازمندی ها

  • لاراول 6+
  • PHP 7.4+

ویژگی ها

  • سریع و ساده
  • اتصال امن
  • سازگار با نوتیفیکیشن

نصب

نصب پکیج به وسیله کامپوزر:

composer require mlk9/ippanel-laravel

عمومی کردن تنظیمات

php artisan vendor:publish --tag=ippanel-laravel

جزئیات دقیق کانفیگ

// config/services.php
'ippanel' => [
        'server' => 'https://ippanel.com/services.jspd',
        'username' => 'YOUR_IPPANEL_USERNAME',
        'password' => 'YOUR_IPPANEL_PASSWORD',
        'originator' => 'YOUR_IPPANEL_ORIGINATOR',
],

استفاده

با استفاده از فساد

<?php
use Mlk9\Sms\Facades\Sms;
//get credit
Sms::getCredit(); // res : 933222.33
//send message
Sms::sendMessage(string $text,array|string $recipients); // bool
//send pattern message
Sms::sendPatternMessage(string $code_pattern,string $recipient,array $entries = []);// bool

با استفاده از نوتیفیکیشن لاراول

افزودن 'sms' به نوتیفیکیشن مد نظر و ایجاد فانکشن toSms به این شکل :

class ExampleNotification extends Notification
{

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['sms'];
    }
//for pattern sms
public function toSms($notifiable)
        {
        return [
            'type' => 'patternMessage',
            'code' => 'YOUR CODE PATTERN',//string
            'values' => ['name'=>$notifiable->name],//array
            'recipient'=>  $notifiable->phone,//string
        ];
    }
//for simple sms
//    public function toSms($notifiable)
//    {
//        return [
//            'type' => 'message',
//            'message' => 'YOUR MESSAGE',
//            'recipient'=>  [$notifiable->phone], // shoud be arrray
//        ];
//     }

About

پکیج لاراولی (6+) ارسال اس ام اس سازگار با نوتیفیکیشن برای آپی پنل

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages