PHPackages                             sysborg/kingsms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sysborg/kingsms

ActiveLibrary[API Development](/categories/api)

sysborg/kingsms
===============

Integração simples com a API da KingSMS para laravel

1.0.8.4(6mo ago)0477↓50%MITPHPPHP &gt;=8.0

Since Mar 29Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/sysborg/kingsms-laravel)[ Packagist](https://packagist.org/packages/sysborg/kingsms)[ RSS](/packages/sysborg-kingsms/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (14)Used By (0)

KingSMS Laravel Package
=======================

[](#kingsms-laravel-package)

Easily integrate [KingSMS](https://www.kingsms.com.br/) into your Laravel application.

This package simplifies the process of sending SMS, retrieving reports, checking balance, and receiving replies using the KingSMS API.

---

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require sysborg/kingsms
```

The service provider is auto-discovered by Laravel, so no need to manually add it to `config/app.php`.

---

⚙️ Configuration
----------------

[](#️-configuration)

Add your KingSMS credentials to your `.env` file:

```
KINGSMS_URL=https://painel.kingsms.com.br/kingsms/api.php
KINGSMS_LOGIN=your_login
KINGSMS_TOKEN=your_token
```

The default API URL is already set, but you can override it if needed.

---

🚀 Usage
-------

[](#-usage)

### Send SMS

[](#send-sms)

```
use Facades\Sysborg\KingSMS\Services\KingSMS;

$response = KingSMS::sendSMS(
    '5598999999999', // Recipient phone number
    'Your message goes here', // Message content
    'Optional Campaign Name',
    'Optional Date (dd/mm/yyyy)',
    'Optional Time (hh:mm)'
);
```

### Get SMS Report

[](#get-sms-report)

```
$response = KingSMS::getRelatorio('your_sms_id');
```

### Check Balance

[](#check-balance)

```
$response = KingSMS::getSaldo();
```

### Get SMS Replies

[](#get-sms-replies)

```
$response = KingSMS::getResposta('read'); // or 'unread'
```

---

🔔 Using as Notification Channel
-------------------------------

[](#-using-as-notification-channel)

You can also send SMS using Laravel's notification system.

### 1. Add `toKingsms()` method in your Notification:

[](#1-add-tokingsms-method-in-your-notification)

```
public function via($notifiable)
{
    return ['kingsms'];
}

public function toKingsms($notifiable)
{
    return 'This is your notification message';
}
```

### 2. Your Notifiable Model must return the phone number

[](#2-your-notifiable-model-must-return-the-phone-number)

To let Laravel know which phone number to use, your notifiable model (usually User) must implement the following method:

```
public function routeNotificationForKingsms(): ?string
{
    // Example: clean Brazilian cellphone format and prepend +55
    $phone = preg_replace('/\D/', '', $this->celular); // or $this->phone
    return $phone ? '+55' . $phone : null;
}
```

Ensure your notifiable entity has a `phone` attribute or method.

---

🔗 Useful Links
--------------

[](#-useful-links)

- 📘 [Official KingSMS API Documentation](https://kingsms.docs.apiary.io/#)
- 🌐 [KingSMS Website](https://www.kingsms.com.br/)

---

👨‍💻 Author
----------

[](#‍-author)

Developed and maintained by:

**Anderson Arruda**
📧

Also maintained by:
**Sysborg**
📧

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance66

Regular maintenance activity

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~18 days

Recently: every ~53 days

Total

13

Last Release

200d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a6c206a9669758146bf810648f37de32eb5cd5c07b8faa66c987b84fe3da696?d=identicon)[sysborg](/maintainers/sysborg)

---

Top Contributors

[![andmarruda](https://avatars.githubusercontent.com/u/29872593?v=4)](https://github.com/andmarruda "andmarruda (13 commits)")[![sysborg](https://avatars.githubusercontent.com/u/59512284?v=4)](https://github.com/sysborg "sysborg (3 commits)")

### Embed Badge

![Health badge](/badges/sysborg-kingsms/health.svg)

```
[![Health](https://phpackages.com/badges/sysborg-kingsms/health.svg)](https://phpackages.com/packages/sysborg-kingsms)
```

###  Alternatives

[echolabsdev/prism

A powerful Laravel package for integrating Large Language Models (LLMs) into your applications.

2.3k388.3k10](/packages/echolabsdev-prism)[aimeos/aimeos-headless

Aimeos headless ecommerce system

2.5k2.3k](/packages/aimeos-aimeos-headless)[rupadana/filament-api-service

A simple api service for supporting filamentphp

204103.8k7](/packages/rupadana-filament-api-service)[sburina/laravel-whmcs-up

WHMCS API client and user provider for Laravel

271.3k](/packages/sburina-laravel-whmcs-up)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
