PHPackages                             hungneox/ramen-messenger - 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. hungneox/ramen-messenger

ActiveLibrary[API Development](/categories/api)

hungneox/ramen-messenger
========================

Lumen/Laravel package for developing facebook messenger chat bot

251PHP

Since Dec 27Pushed 8y ago2 watchersCompare

[ Source](https://github.com/hungneox/ramen-messenger)[ Packagist](https://packagist.org/packages/hungneox/ramen-messenger)[ RSS](/packages/hungneox-ramen-messenger/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Ramen Messenger
===============

[](#ramen-messenger)

[![Build Status](https://camo.githubusercontent.com/0dc9b0aaf05cef5e5542330cdc4e24ab818bca1b145e08ed561f53faf27b26f2/68747470733a2f2f7472617669732d63692e6f72672f68756e676e656f782f72616d656e2d6d657373656e6765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hungneox/ramen-messenger)[![Coverage Status](https://camo.githubusercontent.com/7448a2289cd553b186d694099a26d8d6eab19ea2b47abd34f4d38ba2a50792f7/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f68756e676e656f782f72616d656e2d6d657373656e6765722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/hungneox/ramen-messenger?branch=master)[![StyleCI](https://camo.githubusercontent.com/e1bc7b8965e1d3f13408c6519b9eedbe3564e6e7e16b2a159e666e5e5e20624d/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131343235393534342f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/114259544)[![Latest Unstable Version](https://camo.githubusercontent.com/3a15721866f6a70ff3fe3cb525d7196cb6d8ab8172645cd20b0f8f30fef25892/68747470733a2f2f706f7365722e707567782e6f72672f68756e676e656f782f72616d656e2d6d657373656e6765722f762f756e737461626c65)](https://packagist.org/packages/hungneox/ramen-messenger)[![Total Downloads](https://camo.githubusercontent.com/aefb8cc52f5b72ab44dc3d552b5d4ca3b9366bc1085415d44c5e7317ab4fbe54/68747470733a2f2f706f7365722e707567782e6f72672f68756e676e656f782f72616d656e2d6d657373656e6765722f646f776e6c6f616473)](https://packagist.org/packages/hungneox/ramen-messenger)[![License](https://camo.githubusercontent.com/7aca6786c8fea877346bf0abdb7424da012143324d5acdaab78611ad3d3f0f45/68747470733a2f2f706f7365722e707567782e6f72672f68756e676e656f782f72616d656e2d6d657373656e6765722f6c6963656e7365)](https://packagist.org/packages/hungneox/ramen-messenger)

A La**ra**vel/Lu**men** package for developing facebook messenger chat bot

Usage
=====

[](#usage)

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

[](#installation)

Run the following command to install the package through Composer:

```
composer require composer require hungneox/ramen-messenger

```

Add these environment variables to your .env

```
FACEBOOK_PAGE_ID=
FACEBOOK_VERIFY_TOKEN=
FACEBOOK_ACCESS_TOKEN=

```

Copy the configuration template in config/facebook.php to your application's config directory and modify it to suit your needs.

Add the following line to bootstrap/app.php:

```
$app->register(\Neox\Ramen\Messenger\MessengerServiceProvider::class);
```

To [configure the webhook](https://developers.facebook.com/docs/messenger-platform/getting-started/app-setup) for your app, adding a route for facebook verification

```
$router->get('/webhook', [
    'as'   => 'webhook.index',
    'uses' => 'WebHookController@index'
]);
```

```
/**
 * For facebook verification
 *
 * @param Request $request
 */
public function index(Request $request)
{
    if ($request->get('hub_verify_token') === config('facebook.verify_token')) {
        return $request->get('hub_challenge');
    }

    return 'Wrong verification token!';
}
```

Messenger Service
-----------------

[](#messenger-service)

```
/** @var RamenBot $bot */
$bot = app(RamenBot::class);
$bot->hears('hello', function(RamenBot $bot) {
    $bot->replies('greeting from the bot!');
});
```

Working with templates
----------------------

[](#working-with-templates)

### Text template

[](#text-template)

#### Quick replies

[](#quick-replies)

[![Quick replies](https://camo.githubusercontent.com/0deb9fcf95035512b558ad319947c757f3398c8edb079be62612e222ba4682f2/68747470733a2f2f73636f6e74656e742d61726e322d312e78782e666263646e2e6e65742f762f7433392e323336352d362f31343233353535315f313237343234383233353932373436355f313933353731343538315f6e2e706e673f6f683d6138346238336339653063356131646537636239323163353136323430343438266f653d3541424342413930)](https://camo.githubusercontent.com/0deb9fcf95035512b558ad319947c757f3398c8edb079be62612e222ba4682f2/68747470733a2f2f73636f6e74656e742d61726e322d312e78782e666263646e2e6e65742f762f7433392e323336352d362f31343233353535315f313237343234383233353932373436355f313933353731343538315f6e2e706e673f6f683d6138346238336339653063356131646537636239323163353136323430343438266f653d3541424342413930)

```
$template = (new TextTemplate($sender, 'Please share your location'))
            ->addQuickReply(
                (new QuickReply())->setContentType('location')
            );
```

### Button template

[](#button-template)

[![Button template](https://camo.githubusercontent.com/d79a450438f3e8d88eb91f5cf0fc4c748eedcfc9a5fed2e09e4daf298cc55f75/68747470733a2f2f73636f6e74656e742e6668656c312d312e666e612e666263646e2e6e65742f762f7433392e323336352d362f32333230343237365f3133313630373035303838383933325f313035373538353836323133343436343531325f6e2e706e673f6f683d6563313237663335323731343634373866653230333962333761616634346637266f653d3541434144413041)](https://camo.githubusercontent.com/d79a450438f3e8d88eb91f5cf0fc4c748eedcfc9a5fed2e09e4daf298cc55f75/68747470733a2f2f73636f6e74656e742e6668656c312d312e666e612e666263646e2e6e65742f762f7433392e323336352d362f32333230343237365f3133313630373035303838383933325f313035373538353836323133343436343531325f6e2e706e673f6f683d6563313237663335323731343634373866653230333962333761616634346637266f653d3541434144413041)

```
$template = (new ButtonTemplate())
                ->setRecipientId($sender)
                ->setText('What do you want to do next?')
                ->addButton(
                    (new UrlButton())
                        ->setUrl('https://www.messenger.com')
                        ->setTitle('Get Order Status')
                )->addButton(
                    (new UrlButton())
                        ->setUrl('https://www.messenger.com')
                        ->setTitle('Call Me')
                );
```

```
// Reply the button template when the bot hears `help`
/** @var RamenBot $bot */
$bot = app(RamenBot::class);
$bot->hears('help', function(RamenBot $bot) use ($template) {
    $bot->sends($template);
});
```

### Open graph template

[](#open-graph-template)

[![Open graph template](https://camo.githubusercontent.com/92392c7428cc6a706c9740903cd6bc51975e8133f6acfcf5abe8c0516ee37f2c/68747470733a2f2f73636f6e74656e742d61726e322d312e78782e666263646e2e6e65742f762f7433392e323336352d362f32333432333230335f3136333031313838303937303330365f373737323333303338343031313832313035365f6e2e706e673f6f683d3037623631623765626638373663636366353031636235376330363661396334266f653d3541434543324645)](https://camo.githubusercontent.com/92392c7428cc6a706c9740903cd6bc51975e8133f6acfcf5abe8c0516ee37f2c/68747470733a2f2f73636f6e74656e742d61726e322d312e78782e666263646e2e6e65742f762f7433392e323336352d362f32333432333230335f3136333031313838303937303330365f373737323333303338343031313832313035365f6e2e706e673f6f683d3037623631623765626638373663636366353031636235376330363661396334266f653d3541434543324645)

```
$tempalte = (new OpenGraphTemplate())
            ->addElement(
                (new OpenGraphElement())
                    ->setUrl('https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb')
                    ->addButton(
                        (new UrlButton())
                            ->setUrl('https://en.wikipedia.org/wiki/Rickrolling')
                            ->setTitle('View More')
                    )
            )->setRecipientId($sender);
```

Creating Persistent Menu
------------------------

[](#creating-persistent-menu)

[![Persistent Menu](https://camo.githubusercontent.com/25fef73b504328e6c0243c32ad3bfc14877175f7b6000e3f359fc260f74e5467/68747470733a2f2f73636f6e74656e742e6668656c312d312e666e612e666263646e2e6e65742f762f7433392e323336352d362f31363638363132385f3830343237393834363338393835395f3434333634383236383838333139373935325f6e2e706e673f6f683d3966376466313333636339623634636536343131616137323763383437343935266f653d3541433235314436)](https://camo.githubusercontent.com/25fef73b504328e6c0243c32ad3bfc14877175f7b6000e3f359fc260f74e5467/68747470733a2f2f73636f6e74656e742e6668656c312d312e666e612e666263646e2e6e65742f762f7433392e323336352d362f31363638363132385f3830343237393834363338393835395f3434333634383236383838333139373935325f6e2e706e673f6f683d3966376466313333636339623634636536343131616137323763383437343935266f653d3541433235314436)

```
// Implements the getMenu() method from SetPersistentMenuCommand abstract class
public function getMenu() {
    return (new PersistentMenu())
               ->addMenu(
                   (new Menu())->addItem(
                       (new Menu())
                           ->setType('nested')
                           ->setTitle('My Account')
                           ->addItem(
                               (new PostBackButton())
                                    ->setTitle('Pay Bill')
                                    ->setPayload('PAYBILL_PAYLOAD')
                           )->addItem(
                               (new PostBackButton())
                                    ->setTitle('History')
                                    ->setPayload('HISTORY_PAYLOAD')
                           )->addItem(
                               (new PostBackButton())
                                    ->setTitle('Contact Info')
                                    ->setPayload('CONTACT_INFO_PAYLOAD')
                           )
                   )->addItem(
                       (new UrlButton())
                            ->setTitle('Latest News')
                            ->setUrl('https://yle.fi/uutiset/osasto/news/')
                   )
               )->addMenu(
                   (new Menu())->addItem(
                       (new UrlButton())
                            ->setTitle('Latest News FI')
                            ->setUrl('https://yle.fi/uutiset')
                   )->setLocale('fi_FI')
               );
}
```

License
=======

[](#license)

See [LICENSE](LICENSE)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a7a06397f81bf8434136ee6d71e2bc8f16018f28e6f794781a4dec6ac5b5b98?d=identicon)[hungneox](/maintainers/hungneox)

---

Top Contributors

[![q-hung](https://avatars.githubusercontent.com/u/199614?v=4)](https://github.com/q-hung "q-hung (61 commits)")

---

Tags

facebook-messengerlaravellaravel-5-packagelumenlumen-messenger-sdklumen-packagephpphp-library

### Embed Badge

![Health badge](/badges/hungneox-ramen-messenger/health.svg)

```
[![Health](https://phpackages.com/badges/hungneox-ramen-messenger/health.svg)](https://phpackages.com/packages/hungneox-ramen-messenger)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)[pixelant/pxa-social-feed

Add Facebook, Instagram, and Twitter feeds to your site.

2349.3k](/packages/pixelant-pxa-social-feed)

PHPackages © 2026

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