PHPackages                             mprince/laravel8-viber-bot - 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. mprince/laravel8-viber-bot

ActiveLibrary[API Development](/categories/api)

mprince/laravel8-viber-bot
==========================

Viber bot for Laravel

1312PHP

Since Apr 3Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mprince2k18/laravel8-viber-bot)[ Packagist](https://packagist.org/packages/mprince/laravel8-viber-bot)[ RSS](/packages/mprince-laravel8-viber-bot/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Viber Bot
=========

[](#viber-bot)

[![Latest Version](https://camo.githubusercontent.com/69d19cd094fe219ca8fb67acbf68e2658ccf8c33cf9e287a4b971f249ee0a6c8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f70617261677261662d6c65782f76696265722d626f742e7376673f7374796c653d666c61742d737175617265)](https://github.com/paragraf-lex/viber-bot/releases)[![StyleCI](https://camo.githubusercontent.com/9f5a0a7a2daf268052fb3db274c133ebc49ec218ee3400f4ceef548185e2d283/68747470733a2f2f7374796c6563692e696f2f7265706f732f3136343631313933372f736869656c64)](https://styleci.io/repos/164611937)

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

[](#installation)

This package can be installed through Composer.

```
composer require mprince/laravel8-viber-bot
```

In Laravel 5.5 and above the package will autoregister the service provider. In Laravel 5.4 you must install this service provider.

```
// config/app.php
'providers' => [
    ...
    Paragraf\ViberBot\ViberBotServiceProvider::class,
    ...
];
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Configuration
-------------

[](#configuration)

You need to set in `.env` and setup `webhook`.

#### Env

[](#env)

```
VIBERBOT_API=your_viber_token
VIBERBOT_NAME=name
VIBERBOT_PHOTO=photo
```

You can find Viber token on [Viber Partners](https://partners.viber.com) after creating bot on Info tab.

#### WebHook

[](#webhook)

You must run artisan command for webhoook with url parameter

```
php artisan viber-bot:webhook https://example-url.com/some-route
```

Note: It must be full url and must be HTTPS.

#### Config file

[](#config-file)

Optionally, you can publish the config file of this package with this command:

```
php artisan vendor:publish --provider="Paragraf\ViberBot\ViberBotServiceProvider"
```

The following config file will be published in `config/viberbot.php`

Usage
-----

[](#usage)

When the installation is done you have access to `Bot` and `Client` class.

### Bot class

[](#bot-class)

With bot class you naivgate your ViberBot how to work.

```
(new Bot($request, new TextMessage()))
  ->on(new MessageEvent($request->timestamp, $request->message_token,
  new ViberUser($request->sender['id'],$request->sender['name']), $request->message))
  ->hears("Hi!")
  ->replay("Hello World!")
  ->send();
```

Note: If viber user not set `name` you will get error.

You can change responding type Message and Event who listen that event.

APIAcceptDescription`on(new MessageEvent(...))``Event object`Listen specific Event`hears("Hi!")``string, array, regex`ViberBot listen key word `Hi!`, can be array for more words for one event`body($callback)``callback`ViberBot can do some business logic.`replay("Hello World!")``string, array, Model`ViberBot respond with `Hello World!`, can be array or Model`send()`---Send respond to Viber server.#### List of Events:

[](#list-of-events)

- ConversationStartedEvent
- DeliveredEvent
- FailedEvent
- MessageEvent
- SeenEvent
- SubscribedEvent
- UnsubscribedEvent

Note: If you don't want to listen all events you can change `event_types` in `config/viberbot.php`. If you change you must run again `php artisan viber-bot:webhook your-url` in oreder to apply changes.

#### List of Messages:

[](#list-of-messages)

- TextMessage
- BroadcastMessage
- ContactMessage
- FileMessage
- KeyboardMessage
- LocationMessage
- PictureMessage
- StickerMessage
- URLMessage
- VideoMessage
- WelcomeMessage
- CarouselMessage - ToDo

### Client class

[](#client-class)

Client class, provide to you extra utility.

```
 (new Client())->broadcast('Hello', User::all(), 'viber_id');
```

APIDescription`broadcast($text, $model, $method)`Broadcast message to all subscribed user on Viber Chat, 300 users per request.`getUserDetails($user_id)`Get details for specific user`getOnlineStatus(array $viberIds)`Get online statuses for users, 100 users per request`getAccountInfo()`Get account information (Your Public Account)`removeWebhook()`Remove WebHookNote: `$method` in `broadcast()` must point to viber\_id. Also `getOnlineStatus()` need `viber_ids`.

If you want more information about Viber API or how something works check [Viber REST API](https://developers.viber.com/docs/api/rest-bot-api/)

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Nemanja Ivankovic](https://github.com/necko1996)
- [All Contributors](../../contributors)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43857625?v=4)[Mohammad Prince](/maintainers/mprince2k18)[@mprince2k18](https://github.com/mprince2k18)

---

Top Contributors

[![mprince2k18](https://avatars.githubusercontent.com/u/43857625?v=4)](https://github.com/mprince2k18 "mprince2k18 (7 commits)")

### Embed Badge

![Health badge](/badges/mprince-laravel8-viber-bot/health.svg)

```
[![Health](https://phpackages.com/badges/mprince-laravel8-viber-bot/health.svg)](https://phpackages.com/packages/mprince-laravel8-viber-bot)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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