PHPackages                             boyo/mobica - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. boyo/mobica

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

boyo/mobica
===========

Laravel notifications with Mobica Bulgaria

v2.2(4y ago)0737MITPHPPHP &gt;=7.3

Since Jan 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/boyanraichev/mobica)[ Packagist](https://packagist.org/packages/boyo/mobica)[ Docs](https://github.com/boyanraichev/mobica)[ RSS](/packages/boyo-mobica/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (20)Used By (0)

Mobica Notification channel
===========================

[](#mobica-notification-channel)

This package adds a notification channel for Mobica.bg services. You can use it to send SMS messages and Viber for Business messages.

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

[](#installation)

Install through Composer.

Config
------

[](#config)

Add the following to your services config file.

```
'mobica' => [
	'user' => env('MOBICA_USER',''),
	'pass' => env('MOBICA_PASS',''),
	'prefix' => '',
	'log' => env('MOBICA_LOG',true),
	'log_channel' => env('MOBICA_LOG_CHANNEL','stack'),
	'send' => env('MOBICA_SEND',false),
	'bulglish' => true,
	'allow_multiple' => false,
],
```

- *log* if the messages should be written to a log file
- *log\_channel* the log channel to log messages to
- *send* if the messages should be sent (production/dev environment)
- *bulglish* if cyrillic text should be converted to latin letters for SMS messages (cyrillic messages are limited to 67 characters)
- *allow\_multiple* if SMS messages above 160 characters should be allowed (billed as multiple messages)

Send test
---------

[](#send-test)

To send a test message use the following artisan command:

`php artisan mobica:test phone --message='content' --channel=sms --promo`

- channel can have the following values: sms|viber|viber-sms
- promo will send a promo test message with image and button

Direct usage
------------

[](#direct-usage)

You can instantiate a `Boyo\Mobica\MobicaMessage` object and send it immediately.

```
use Boyo\Mobica\MobicaMessage;
use Boyo\Mobica\MobicaSender;

class MyClass
{
	public function myFunction()
	{
		$message = (new MobicaMessage())->to('359888888888')->channel('viber-sms')->sms('SMS text')->viber('Viber text');

		$client = new MobicaSender();
		$client->send($message);
	}
}
```

Usage with notifications
------------------------

[](#usage-with-notifications)

1. Create a message file that extends `Boyo\Mobica\MobicaMessage`. It can take whatever data you need in the construct and should implement a `build()` method that defines the messages text content - a good practice would be to render a view file, so that your message content is in your views. You should only define the methods for the delivery channels that your are going to use.

```
use Boyo\Mobica\MobicaMessage;

class MyMessage extends MobicaMessage
{
	public function __construct($data)
    {
        $this->id = $data->id; // your unique message id, add other parameters if needed
    }

	public function build() {
		// set your sms text
		$this->sms('SMS text');

		// set your viber text
		$this->viber('Viber text');

		return $this;
	}
}
```

2. In your Notification class you can now include the Mobica channel in the `$via` array returned by the `via()` method.

```
use Boyo\Mobica\MobicaChannel;

via($notifiable)
{

	// ...

	$via[] = MobicaChannel::class;

	return $via

}
```

Within the same Notification class you should also define a method `toSms()`:

```
public function toSms($notifiable)
{
	return (new MyMessage($unique_id))->to($notifiable->phone)->channel('viber-sms');
}
```

The channel method is where you define the delivery channel you wish to use.

- **sms** delivery by sms only (this is the default value, if you omit the channel method)
- **viber** delivery by viber only
- **viber-sms** delivery attempted by viber, if not successful delivery by sms

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~41 days

Recently: every ~89 days

Total

19

Last Release

1588d ago

Major Versions

v0.9 → v1.02020-02-06

v1.6 → v2.02021-01-20

PHP version history (3 changes)v0.1PHP &gt;=7.0.0

v2.1PHP &gt;=7.2

v2.2PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15925335?v=4)[Boyan Raichev](/maintainers/boyanraichev)[@boyanraichev](https://github.com/boyanraichev)

---

Top Contributors

[![boyanraichev](https://avatars.githubusercontent.com/u/15925335?v=4)](https://github.com/boyanraichev "boyanraichev (21 commits)")

---

Tags

laravelnotificationssmsmobica

### Embed Badge

![Health badge](/badges/boyo-mobica/health.svg)

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

###  Alternatives

[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[vemcogroup/laravel-sparkpost-driver

SparkPost driver to use with Laravel 6.x|7.x|8.x|9.x|10.x

421.7M1](/packages/vemcogroup-laravel-sparkpost-driver)

PHPackages © 2026

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