Coder Social home page Coder Social logo

alasysys / laravel-4jawaly-sms Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 102 KB

Awesome Laravel ๐Ÿ”ฅ package for sending SMS using https://www.4jawaly.net gateway ุญุฒู…ุฉ ู„ุงุฑุงููŠู„ ู„ุฎุฏู…ุฉ ุงู„ุฑุณุงุฆู„ ุงู„ู‚ุตูŠุฑุฉ ุงู„ู…ู‚ุฏู…ุฉ ู…ู† ููˆุฑุฌูˆุงู„ูŠ

License: Other

PHP 100.00%

laravel-4jawaly-sms's Introduction

License Total Downloads GitHub release (latest by date) Packagist Version Packagist Stars

ู…ูƒุชุจุฉ ู„ุงุฑุงููŠู„ ู„ู…ุฒูˆุฏ ุฎุฏู…ุฉ ุงู„ุฑุณุงุฆู„ ุงู„ู‚ุตูŠุฑุฉ ููˆุฑ ุฌูˆุงู„ูŠ

Laravel 4Jawaly sms Library https://www.4jawaly.net

This is a Laravel ๐Ÿ”ฅ package to send SMS using https://www.4jawaly.net ๐Ÿฅณ account

Installation

  1. Install the package using composer:
  • for apps with Laravel 8 and before:
composer require alkoumi/laravel-4jawaly-sms:1.4
  • for apps from Laravel 9 :
composer require alkoumi/laravel-4jawaly-sms
  1. The service provider will automatically registered. Or you may manually do in your config/app.php file:
'providers' => [
          //...
          Alkoumi\Laravel4jawalySms\Laravel4jawalySmsServiceProvider::class,
    ];
  1. Publish ๐Ÿฅณ the configuration ๐Ÿ’ผ file using this command:
php artisan vendor:publish --provider='Alkoumi\Laravel4jawalySms\Laravel4jawalySmsServiceProvider'
  1. In your .env file add your https://www.4jawaly.net credentials details like:
4JAWALY_SMS_USERNAME=@username
4JAWALY_SMS_PASSWORD=@password
4JAWALY_SMS_FORMALSENDER=@formal-sender
4JAWALY_SMS_ADSSENDER=@Ads-sender
[email protected]

5- Don't forget to php artisan optimize:clear after editing .env file

Usage [ as elegant as Laravel ๐Ÿ”ฅ ] with auto compeletion by ide-helper

Shamel

 use Alkoumi\Laravel4jawalySms\Facades\JawalySms;
 
    $message = 'ุฌุนู„ ุงู„ู„ู‡ ู…ุง ู‚ุฏู…ุชูƒู… ู†ู‡ุฑู‹ุง ุฌุงุฑูŠู‹ุง ู…ู† ุงู„ุญุณู†ุงุช';
    
    
    # in multiple Lines with collection
    JawalySms::message($message)                // ๐Ÿ”ฅ { required } the test message to send
            ->to(User::all())                   // ๐Ÿ”ฅ { required } as Mixed|array|object|collection
            ->asFormal()                        // { optional } the Ads-sender used by default unless you add ->asFormal() 
            ->send();                           // ๐Ÿ”ฅ { required } at the end to send ๐Ÿง
            
            
   # in One Liner with Builder
   JawalySms::message($message)->to(DB::table('users')->get())->send();

Usage in .blade.php files get your Balance ๐Ÿ˜‰

    {{ JawalySms::getBalance() }}         // Return poients (int) 134534

1- For one recipient, You must pass types Mixed|Array like ->to('0500175200') or ->to(['0500175200']).

2- If you have database field $user->mobile then you can pass types Array|Object|Collection|Builder.

3- For multiple recipients, Just pass types Array|Object|Collection in ->to(User::all()).

4- If you pass types of Array|Object|Collection, We will tack care ๐Ÿ˜Ž of getting mobile numbers.

5- By default Ads sender name will used, unless you add ->asFormal() to use formal sender name from https://www.4jawaly.net.

6- Add admin_email in .env OR config\4jawaly-sms.php to notify Admin with results in every request.

Unit Testing

1- cd to the package directory and composer install.

2- Add you 4Jawaly account details in SMSTestCase::class in protected function defineEnvironment($app).

3- run vendor/bin/phpunit --filter ENJOY ๐Ÿคฉ๐Ÿฅณ.

Give Me ๐Ÿ’— Cup of โ˜•๏ธ Coffee here https://patreon.com/mohammadelkoumi

laravel-4jawaly-sms's People

Contributors

alkoumi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.