PHPackages                             samiaraboglu/fb-messenger-bot-php - 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. samiaraboglu/fb-messenger-bot-php

ActiveLibrary[API Development](/categories/api)

samiaraboglu/fb-messenger-bot-php
=================================

v2.0.0(5y ago)1031.0k↓68.8%71MITPHPPHP &gt;=5.5

Since Apr 12Pushed 5y ago2 watchersCompare

[ Source](https://github.com/samiaraboglu/fb-messenger-bot-php)[ Packagist](https://packagist.org/packages/samiaraboglu/fb-messenger-bot-php)[ Docs](https://github.com/samiaraboglu/fb-messenger-bot-php)[ RSS](/packages/samiaraboglu-fb-messenger-bot-php/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (5)Used By (1)

fb-messenger-bot-php
====================

[](#fb-messenger-bot-php)

[![Latest Stable Version](https://camo.githubusercontent.com/616f3efc329aa43ba9b8de17ca5607db24d8999f6f5dba5af8e239719a9fadb4/68747470733a2f2f706f7365722e707567782e6f72672f73616d69617261626f676c752f66622d6d657373656e6765722d626f742d7068702f762f737461626c65)](https://packagist.org/packages/samiaraboglu/fb-messenger-bot-php)[![Total Downloads](https://camo.githubusercontent.com/1c9cd6f67976e622f4667d726a6fbf8e4ef8d7cb5afcea4e590ac138a9dacf44/68747470733a2f2f706f7365722e707567782e6f72672f73616d69617261626f676c752f66622d6d657373656e6765722d626f742d7068702f646f776e6c6f616473)](https://packagist.org/packages/samiaraboglu/fb-messenger-bot-php)[![License](https://camo.githubusercontent.com/7c6394f212d116826514f54de0214d1d73ce15679aa4861fe25cad1d56dced3e/68747470733a2f2f706f7365722e707567782e6f72672f73616d69617261626f676c752f66622d6d657373656e6765722d626f742d7068702f6c6963656e7365)](https://packagist.org/packages/samiaraboglu/fb-messenger-bot-php)

- [Facebook Messenger Official Documentation](https://developers.facebook.com/docs/messenger-platform)
- [Bundle for Symfony](https://github.com/samiaraboglu/fb-messenger-api-bundle)

### Installing

[](#installing)

Via composer

```
$ composer require samiaraboglu/fb-messenger-bot-php

```

Config

```
$messenger = new \FbMessengerBot\Messenger('');
```

Conversation Components
=======================

[](#conversation-components)

Use the message class

```
$message = new \FbMessengerBot\Message();
```

### Text Message

[](#text-message)

```
$message->text('');
```

### Assets &amp; Attachments

[](#assets--attachments)

##### Audio

[](#audio)

```
$message->audio('');
```

##### Video

[](#video)

```
$message->video('');
```

##### Image

[](#image)

```
$message->image('');
```

##### File

[](#file)

```
$message->file('');
```

### Message Templates

[](#message-templates)

#### Button Template

[](#button-template)

##### URL Button

[](#url-button)

```
// simple
$message->url('', '', '');
```

```
// multiple
$message->button('', [
    [
        'title' => '',
        'url' => ''
    ],
    [
        'title' => '',
        'url' => ''
    ],
    [
        ...
    ],
    [...]
]);
```

##### Postback Button

[](#postback-button)

```
// simple
$message->postback('', '', '');
```

```
// multiple
$message->button('', [
    [
        'type' => 'postback',
        'title' => '',
        'payload' => ''
    ],
    [
        ...
    ],
    [...]
]);
```

##### Share Button

[](#share-button)

```
// TO DO
```

##### Buy Button

[](#buy-button)

```
// TO DO
```

##### Call Button

[](#call-button)

```
// simple
$message->call('', '', '+');
```

```
// multiple
$message->button('', [
    [
        'type' => 'phone_number',
        'title' => '',
        'payload' => ''
    ],
    [
        ...
    ],
    [...]
]);
```

##### Log In Button

[](#log-in-button)

```
$message->login('', '');
```

##### Log Out Button

[](#log-out-button)

```
$message->logout('');
```

##### Game Play Button

[](#game-play-button)

```
// TO DO
```

### Quick Replies

[](#quick-replies)

##### Text

[](#text)

```
// simple
$message->quickReplie('', '', '');
```

```
// multiple
$message->quickReplies('', [
    [
        'title' => '',
        'payload' => ''
    ],
    [
        ...
    ],
    [...]
]);
```

##### Text With Image

[](#text-with-image)

```
// simple
$message->quickReplie('', '', '', '');
```

```
// multiple
$message->quickReplies('', [
    [
        'title' => '',
        'payload' => '',
        'image' => ''
    ],
    [
        ...
    ],
    [...]
]);
```

##### Location

[](#location)

```
// simple
$message->location('');
```

```
// multiple
$message->quickReplies('', [
    [
        'type' => 'location'
    ],
    [
        ...
    ],
    [...]
]);
```

##### Phone Number

[](#phone-number)

```
// simple
$message->phoneNumber('');
```

```
// multiple
$message->quickReplies('', [
    [
        'type' => 'user_phone_number'
    ],
    [
        ...
    ],
    [...]
]);
```

##### Email

[](#email)

```
// simple
$message->email('');
```

```
// multiple
$message->quickReplies('', [
    [
        'type' => 'user_email'
    ],
    [
        ...
    ],
    [...]
]);
```

### Send Message

[](#send-message)

Require page-scoped ID (PSID)

```
$response = $messenger->send(, $message);
```

Example response

```
// response print
Array
(
    [recipient_id] =>
    [message_id] => mid.$cAAoZdzlbwyxoOR257liB9xxxxxx
)
```

#### Saving Assets for Attachments

[](#saving-assets-for-attachments)

Send second parameter *true*. Supported asset types: `image` `audio` `video` `file`

```
$message->image('', true);
```

Example response

```
// response print
Array
(
    [recipient_id] =>
    [message_id] => mid.$cAAcZdzlzwkxoQ6ss8ViEmxxxxxx
    [attachment_id] => 1200933831599999
)
```

Send message with *attachment\_id*

```
$message->image();
```

#### Get Body

[](#get-body)

```
$body = $messenger->getBody();

// body print
Array
(
    [recipient] => Array
        (
            [id] => ...
        )

    [message] => Array
        (
            [attachment] => Array
                (
                    [type] => image
                    [payload] => Array
                        (
                            [url] => https://...
                        )

                )

        )

    [access_token] => ...
)
```

### Sender Actions

[](#sender-actions)

Action types: `mark_seen` `typing_on` `typing_off`

```
$response = $messenger->senderAction(, '');
```

### Webhooks

[](#webhooks)

This for require *verify\_token*

Config

```
$messenger = new \FbMessengerBot\Messenger('', '');
```

Listen to user messages.

```
$response = $messenger->listen();
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community13

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

Total

4

Last Release

2073d ago

Major Versions

0.1.0 → 1.5.02018-01-31

1.6.5 → v2.0.02020-10-29

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8626159?v=4)[Sami Araboğlu](/maintainers/samiaraboglu)[@samiaraboglu](https://github.com/samiaraboglu)

---

Top Contributors

[![samiaraboglu](https://avatars.githubusercontent.com/u/8626159?v=4)](https://github.com/samiaraboglu "samiaraboglu (31 commits)")

---

Tags

apifacebookmessengerphpfacebookMessengerfacebook messengerfacebook-messenger-bot

### Embed Badge

![Health badge](/badges/samiaraboglu-fb-messenger-bot-php/health.svg)

```
[![Health](https://phpackages.com/badges/samiaraboglu-fb-messenger-bot-php/health.svg)](https://phpackages.com/packages/samiaraboglu-fb-messenger-bot-php)
```

###  Alternatives

[kerox/messenger

PHP Library to interact with Facebook Messenger Platform

58318.7k1](/packages/kerox-messenger)[tgallice/fb-messenger-sdk

Facebook Messenger Bot php sdk

9315.3k](/packages/tgallice-fb-messenger-sdk)[edbizarro/laravel-facebook-ads

Facebook &amp; Instagram Ads for Laravel 5.6+

13629.9k](/packages/edbizarro-laravel-facebook-ads)[casperlaitw/laravel-fb-messenger

A Laravel Package to Integrate Facebook Messenger API

10431.8k](/packages/casperlaitw-laravel-fb-messenger)

PHPackages © 2026

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