Giter VIP home page Giter VIP logo

laravel-verimor-sms's Introduction

Laravel Verimor SMS

Latest Stable Version Total Downloads Latest Unstable Version License

Easy sending sms on Verimor SMS API.

NOTE: These instructions are for the latest version of Laravel.

Installation

  1. Install the package via Composer:

    composer require emrebbozkurt/laravel-verimor-sms
  2. Publish the configuration file if you want to change any defaults:

    php artisan vendor:publish --provider="Emrebbozkurt\VerimorSms\VerimorServiceProvider"

Configuration

Add this fields to .env file:

VERIMOR_USERNAME=908501234567
VERIMOR_API_KEY=xxxxxxx

You can set from verimor config file the default values for extra parameters:

return [
    'username' => env('VERIMOR_USERNAME', '908501234567'),
    'password' => env('VERIMOR_API_KEY', 'xxxxxxx'),
    'custom_id' => uniqid()
    'datacoding' => '0',
    'valid_for' => '48:00',
];

Usage

Simple Send:

$sms = Verimor::send('+905431231234', 'Hello');
$response = $sms->response();
$status = $sms->status();

Send with extra parameters:

$sms = Verimor::send('+905431231234', 'Hello', ['custom_id' => uniqid(), 'datacoding' => '0', 'valid_for' => '48:00']);
$response = $sms->response();
$status = $sms->status();

Support

Please use GitHub for reporting bugs, and making comments or suggestions.

Copyright and License

laravel-verimor-sms was written by Emre Bozkurt and is released under the MIT License.

Copyright (c) 2022 Emre Bozkurt

laravel-verimor-sms's People

Contributors

bozkurtemre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-verimor-sms's Issues

Access to undeclared static property Emrebbozkurt\VerimorSms\VerimorService::$to

Merhabalar, örnekte olduğu gibi send metodu kullanmaya çalışıldığında sistemin verdiği hata:

Access to undeclared static property Emrebbozkurt\VerimorSms\VerimorService::$to

Ayrıca emeklerin için teşekkürler @emrebbozkurt

Ek: config app.php içine service provider tanımlamaya çalıştım orada da hata aynıydı.

INVALID_SOURCE_ADDRESS

Illuminate\Http\JsonResponse {#1339 ▼ // app/Http/Controllers/SMSController.php:22
  +headers: Symfony\Component\HttpFoundation\ResponseHeaderBag {#1338 ▶}
  #content: "{"message":"INVALID_SOURCE_ADDRESS","status":400}"
  #version: "1.0"
  #statusCode: 200
  #statusText: "OK"
  #charset: null
  #data: "{"message":"INVALID_SOURCE_ADDRESS","status":400}"
  #callback: null
  #encodingOptions: 0
  +original: array:2 [▶]
  +exception: null
}

Deneme 1: ( Class metodunu okumuyor hatası vardı, fakat çalıştı gelen cevap aynıydı.)

public function sendSMS() {
        $sms = Verimor::send('xxxxxxx', 'Merhaba, bu bir test mesajıdır.');
        $response = $sms->response();
        $status = $sms->status();
        dd($response);
 }

Deneme 2: ( Class metodunu okumadığı için ters slaş attım, hata aynıydı. )

    public function sendSMS() {
        $sms = \Verimor::send('xxxxxxx', 'Merhaba, bu bir test mesajıdır.');
        $response = $sms->response();
        $status = $sms->status();
        dd($response);
    }

Ek olarak SMS paketi var.
IP izni verildi. Hem remote server'da denedim hem localde.
API Şifresi doğru
Gönderen telefon doğru.

Buda bonus, message parametresine veri gitmiyor heralde.

Emrebbozkurt\VerimorSms\VerimorSms {#347 ▼ // app/Http/Controllers/SMSController.php:22
  #config: array:5 [▶]
  #to: "+xxxxx"
  #message: []
  #params: null
  #response: array:2 [▶]
  #status: 400
}

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.