wallacemyem / lara-termii
A Laravel Package for Termii - https://www.termii.com
dev-master
2025-03-06 17:15 UTC
Requires
- php: ^8.2
- ext-json: *
- guzzlehttp/guzzle: ^7.7
- illuminate/support: ^9.0|^10.0
Requires (Dev)
- laravel/pint: ^1.10
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.8
- pestphp/pest-plugin-laravel: ^2.0
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2025-05-06 19:01:36 UTC
README
Termii Laravel Package
Lara-Termii helps you Set up, test, and manage your Termii integration directly in your Laravel App.
Installation
You can install the package via composer:
composer require Wallacemyem/lara-termii
Configuration
- Add the service provider to
config/app.php
(Laravel will auto-discover it in most cases):
'providers' => [ // ... Wallacemyem\LaraTermii\LaraTermiiServiceProvider::class, ], 'aliases' => [ // ... 'LaraTermii' => Wallacemyem\LaraTermii\Facades\LaraTermii::class, ],
- Publish the configuration file:
php artisan vendor:publish --provider="Wallacemyem\LaraTermii\LaraTermiiServiceProvider"
- Add your Termii API key to your
.env
file:
TERMII_API_KEY=your-api-key-here
Usage
You can use the facade or dependency injection:
// Using facade use Wallacemyem\LaraTermii\Facades\LaraTermii; LaraTermii::balance(); // Using dependency injection use Wallacemyem\LaraTermii\LaraTermii; public function someMethod(LaraTermii $termii) { $balance = $termii->balance(); }
Check your balance on Termii
- You can check your termii balance.
- Run
$termii->balance()
Reports for messages sent across the sms, voice & whatsapp channels
- You can check reports for messages sent across the sms, voice & whatsapp channels.
- Run
$termii->history()
Detect if a number is fake or has ported to a new network
- You can check if a number is fake or has ported to a new network.
- Run
$termii->numberStatus($phone_number, $country_code)
and pass appropriate params
Verify phone numbers and automatically detect their status
- You can verify phone numbers and automatically detect their status.
- Run
$termii->searchNumber($phone_number)
and pass appropriate params
Retrieve the status of all registered sender ID
- You can retrieve the status of all registered sender IDs.
- Run
$termii->getSenderIds()
Request a new sender ID
- You can request a new sender ID.
- Run
$termii->requestSenderId($sender_id, $usecase, $company)
and pass appropriate params
Send Message
- You can a message.
- Run
$termii->sendMessage(int $to, string $from, string $sms, string $channel = "generic", bool $media = false, string $media_url = null, string $media_caption = null)
and pass appropriate params
Send OTP
- You can send OTP
- Run
$termii->sendOTP(int $to, string $from, string $message_type, int $pin_attempts, int $pin_time_to_live, int $pin_length, string $pin_placeholder, string $message_text, string $channel = "generic")
and pass appropriate params
Send Voice OTP
- You can send OTP
- Run
$termii->sendVoiceOTP(int $to, int $pin_attempts, int $pin_time_to_live, int $pin_length)
and pass appropriate params
Send Voice Call
- You can send OTP
- Run
$termii->sendVoiceCall(int $to, int $code)
and pass appropriate params
OTP Validation
- You can verify or validate OTP
- Run
$termii->verifyOTP(string $pinId, string $pin)
pass appropriate params
Send In-App OTP
- You can send In-App OTP
- Run
$termii->sendInAppOTP(int $to, int $pin_attempts, int $pin_time_to_live, int $pin_length, string $pin_type)
and pass appropriate params
Sotel eSIMs API
- Coming soon
Security
If you discover any security related issues, please email wallacemyem@hotmail.com instead of using the issue tracker. This is a fork from https://github.com/zeevx/lara-termii and I have added more fixes to make it work.
Credits
License
The MIT License (MIT). Please see License File for more information.