oursms.app client library that allows you to send SMS

Overview

Oursms laravel client

Codacy Badge

https://oursms.app client library that allows you to send SMS

Installation

Install oursms client with composer

  composer require khalidsheet/oursms

Skip this if you are running laravel version 5.5 or later The package will be auto-discovered

Otherwise run this command

Step 1 - Publish the package config file under config/oursms.php

  php artisan vendor:publish --provider="Khalidsheet\Oursms\OursmsServiceProvider" --tag="config"

Step 2 - Go to the application .env and paste these variables in the end of the file.

OURSMS_USER_ID=""
OURSMS_KEY=""

Usage/Examples

Import the package

use Khalidsheet\Oursms\Oursms

In your controller instantiate a new instance from Oursms Client

$oursmsClient = new Oursms();

If you wish to send a single message

$oursmsClient->sendMessage(string $to, string $message);

If you wish to send Otp message

$oursmsClient->sendOtp(string $to, string $otp);

If you wish to check the status of your message

$oursmsClient->getSmsStatus(string $messageId);

Notice: to is the phone number, message is the actuall mesasge that will be send to the user.

Trait Usage/Examples

Also, you can use trait to send SMS or OTP messages to a user

Add the Messageable trait to your model.

use Khalidsheet\Oursms\Traits\Messageable;

class User extends Model {
     use Messageable;

     ...
}

Now you can use it like this

$user = User::find(1);

// Sending OSM 
$user->sendMessage(string $message);

// Sending OTP
$user->sendOtp(string $otp);

Notice: Trait functionality only available from version 1.1.0 or later

Authors

License

MIT

You might also like...
PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

The official Previewify.app PHP Client
The official Previewify.app PHP Client

Previewify for PHP This is the official Previewify client for PHP. Support us Like our work? You can support us by purchasing one of our products. Ins

Code Quiz MonoRepo (API, API Client, App)

Code Quiz Welcome to the Code Quiz Open Source project from How To Code Well. This is an Open Source project that includes an API and an App for the d

Laravel Package for 1APP. Learn how to integrate our APIs to build a web or mobile integration to send and accept payments for your application and businesses.
Laravel Package for 1APP. Learn how to integrate our APIs to build a web or mobile integration to send and accept payments for your application and businesses.

1APP Laravel Library Learn how to integrate our APIs to build a web or mobile integration to accept payments, make payment of Bills and as well custom

HTTP Requestor: Package for a client request that supports you to make an external service request easily and with fast usage.

HttpRequestor from Patienceman HTTP Requestor: Package for a client request that supports you to make an external service request easily and with fast

PHP client library for the DynamicPDF Cloud API.
PHP client library for the DynamicPDF Cloud API.

PHP Client (php-client) The PHP Client (php-client) project uses the DynamicPDF Cloud API's PHP client library to create, merge, split, form fill, sta

Client library to consume the 42 Intranet's API

ft-client Client library to consume the 42 Intranet's API Installation composer require mehdibo/ft-client Usage examples Using the Authorization Code

API Client library for PHP

ChronoSheetsAPI ChronoSheets is a flexible timesheet solution for small to medium businesses, it is free for small teams of up to 3 and there are iOS

A bot that translates the words you choose during the chat in Telegram to the language you want.
A bot that translates the words you choose during the chat in Telegram to the language you want.

About Needy Telegram Translator If you are constantly using telegram and want to translate words into different languages, this library is for you. Qu

Releases(1.1.0)
  • 1.1.0(Jun 9, 2021)

    Usage/Examples

    Now, you can use trait to send SMS or OTP messages to a user

    Add the Messageable trait to your model.

    class User extends Model {
         use Messageable;
    
         .
         .
         .
    }
    

    Now you can use it like this

    
      $user = User::find(1);
    
      // Sending OSM 
      $user->sendMessage(string $message);
    
      // Sending OTP
      $user->sendOtp(string $otp);
    
    
    Source code(tar.gz)
    Source code(zip)
Owner
Khalid Mohammad
Web Application Developer
Khalid Mohammad
Пакет позволяющий работать с REST API SMS-сервиса «SMS Aero»

SMS-сервис «SMS Aero» ?? Пакет позволяющий работать с REST API SMS-сервиса «SMS Aero» ?? Изменения: Все заметные изменения в этом проекте будут задоку

Артём Соколовский 2 Feb 6, 2022
A simple Object Oriented PHP Client for Termii SMS API

Termii Client A simple Object Oriented PHP Client for Termii SMS API. Uses Termii API. Requirements PHP >= 7.2 Guzzlehttp ~6|~7 Installation Via Compo

Ilesanmi Olawale Adedotun 5 Feb 24, 2022
Nexmo REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Client Library for PHP Support Notice This library and it's associated packages, nexmo/client and nexmo/client-core have transitioned into a "Maintena

Nexmo 75 Sep 23, 2022
⚡️ Web3 PHP is a supercharged PHP API client that allows you to interact with a generic Ethereum RPC.

Web3 PHP is a supercharged PHP API client that allows you to interact with a generic Ethereum RPC. This project is a work-in-progress. Code and docume

Web3 PHP 665 Dec 23, 2022
A2Reviews Client API lets you build apps, extensions or plugins to get reviews from the A2reviews APP

A2Reviews Client API lets you build apps, extensions or plugins to get reviews from the A2reviews APP. Including adding reviews to a store's products. It is used to import and export reviews through the API. This is the official package built and developed by A2Reviews, Inc.

Be Duc Tai 2 Sep 25, 2021
Google-api-php-client - A PHP client library for accessing Google APIs

Google APIs Client Library for PHP Reference Docs https://googleapis.github.io/google-api-php-client/main/ License Apache 2.0 The Google API Client Li

Google APIs 8.4k Dec 30, 2022
OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

Mounir R'Quiba 6 Jun 14, 2023
یک پکیج لاراول برای ارسال ، دریافت و... پیامک (SMS)

پکیج لاراول SMS با استفاده از این پکیج می توانید به پنل خود در وب سایت sms.ir متصل شوید و یک سیستم ارسال و دریافت SMS ایرانی در لاراول داشته باشید. به

Ali Zeinodin 15 Nov 30, 2022
This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via PHP

This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via PHP

Twilio SendGrid 1.4k Dec 27, 2022
Lightweight PHP library for WhatsApp API to send the whatsapp messages in PHP provided by ultramsg.com

Ultramsg.com WhatsApp API PHP SDK Lightweight PHP library for WhatsApp API to send the whatsappp messages in PHP provided by Ultramsg.com Installation

Ultramsg 117 Dec 26, 2022