PHPackages                             valinteca-test/localization - 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. valinteca-test/localization

ActiveLibrary

valinteca-test/localization
===========================

valinteca test localization

1.0.4(2y ago)010MITPHPPHP ^8.0

Since May 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/kareem-torky/valinteca-test-locale)[ Packagist](https://packagist.org/packages/valinteca-test/localization)[ RSS](/packages/valinteca-test-localization/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Localization package
--------------------

[](#localization-package)

A composer package from Valinteca that introduces an easy integration with [Localization](https://www.Localization.com/index.php?lang=Ar) platform for Laravel applications.

Features
--------

[](#features)

- Send SMS messages
- Send personalized messages
- Send &amp; verify OTP codes
- Manage senders
- Message cost calculation
- Balance inquiry

Installation
------------

[](#installation)

```
composer require valinteca/Localization

```

To publish configurations:

```
php artisan vendor:publish --provider="Valinteca\Localization\LocalizationServiceProvider"

```

This will publish config file to config/Localization.php

Then add these keys to .env file:

```
Localization_USERNAME="VALUE_HERE" # From your Localization subscription
Localization_API_KEY="VALUE_HERE" # From your Localization subscription
Localization_SENDER_NAME="VALUE_HERE" # Custom sender name
Localization_LANG="VALUE_HERE" # Language ("En" or "Ar")

```

Usage
-----

[](#usage)

```
use Valinteca\Localization\Facades\Localization;
```

### **Send message**

[](#send-message)

*to:* acccepts number or array of numbers

*at:* accepts time to send in format "Y-m-d H:i:s" or a *Carbon* instance

*message:* acccepts message text

*send:* performs operation and returns response

***Examples***

- with default settings:

```
Localization::to('05xxxxxxxx')
    ->message('hello world')
    ->send();
```

- Custom sender:
    Use *sender* method for custom sender name. If you didn't use this method then default sender name from config/env will be used.

```
Localization::sender('another sender')
    ->to('05xxxxxxxx')
    ->message('hello world')
    ->send();
```

- Multiple numbers:
    Pass an array to *to* method.

```
Localization::to(['05xxxxxxxx', '05xxxxxxxx'])
    ->message('hello world')
    ->send();
```

- At later time:
    Pass datetime to *at* method.

```
// Using string datetime format
Localization::to('05xxxxxxxx', '05xxxxxxxx')
    ->message('hello world')
    ->at('2023-05-01 20:10:05')
    ->send();

// Using carbon instance
Localization::to('05xxxxxxxx', '05xxxxxxxx')
    ->message('hello world')
    ->at(now()->addMinutes(5))
    ->send();
```

- Custom options:
    Pass options to *options* method Available options are:

    1- reqBulkId: to get msg id of the bulk (*true* or *false*, default is *false*)

    2- msgEncoding: (*UTF8* or *windows-1256*, default is *UTF8*)

    3- reqFilter: to filter the duplicated numbers (*true* or *false*, default is *true*)

```
Localization::to('05xxxxxxxx')
    ->options([
        'reqBulkId' => true,
        'msgEncoding' => 'windows-1256',
        'reqFilter' => false,
    ])
    ->message('hello world')
    ->send();
```

### **Send personalized messages**

[](#send-personalized-messages)

Personalized messages are message with different SMS content for each number in array. To send personalized messages use *sendPersonalized* method with an array of variables for each number.

Message body should contain the message body including the variables that should be between curly brackets {}.

```
Localization::to(['05xxxxxxxx', '05yyyyyyyy'])
    ->message('Hello {name}. Your order {order} will be delivered soon')
    ->sendPersonalized([
        ['name' => 'Mohammed', 'order' => '123'],
        ['name' => 'Ahmed', 'order' => '456'],
    ]);

    // Messages:
    // 05xxxxxxxx: "Hello Mohammed. Your order 123 will be delivered soon"
    // 05yyyyyyyy: "Hello Ahmed. Your order 456 will be delivered soon"
```

### **Send test message**

[](#send-test-message)

You can test Localization API for free . You will get free sms every day . To test service you can send sms using *sendTestMessage* method.

This method uses predefined sender name and message text. so you will define numbers only.

```
Localization::to('05xxxxxxxx')
    ->sendTestMessage();
```

### **Balance Inquiry**

[](#balance-inquiry)

To inquire about your balance use *getBalance* method

```
Localization::getBalance();
```

### **Get messages**

[](#get-messages)

To get messages for bulk ID use *forbulkId* method with *getMessages*. The result is paginated and default return is page 1.

```
Localization::forBulkId('bulk-id-returned-from-send-method')
    ->getMessages();
```

To define page number use *page* method:

```
Localization::forBulkId('bulk-id-returned-from-send-method')
    ->page(2)
    ->getMessages();
```

To define limit use *limit* method:

```
Localization::forBulkId('bulk-id-returned-from-send-method')
    ->page(1)
    ->limit(5)
    ->getMessages();
```

### **Calculate message cost**

[](#calculate-message-cost)

```
Localization::to(['05xxxxxxxx', '05yyyyyyyy'])
    ->message('this is message')
    ->calculateCost();
```

*Response:*

```
{
    "success": true,
    "data": {
        "cost": "3,9"
    }
}
```

### **Get user balance**

[](#get-user-balance)

```
Localization::getBalance();
```

*Response:*

```
{
    "success": true,
    "data": {
        "balance": "3042.00"
    }
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

739d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/01dea2a5870e52a6b1c4796ce676cbbd13f9be78749c8f36b78451a56996c0a5?d=identicon)[kareem-torky](/maintainers/kareem-torky)

---

Top Contributors

[![kareem-torky](https://avatars.githubusercontent.com/u/38352432?v=4)](https://github.com/kareem-torky "kareem-torky (5 commits)")

### Embed Badge

![Health badge](/badges/valinteca-test-localization/health.svg)

```
[![Health](https://phpackages.com/badges/valinteca-test-localization/health.svg)](https://phpackages.com/packages/valinteca-test-localization)
```

PHPackages © 2026

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