PHPackages                             adolphyu/laravel-facebook-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. adolphyu/laravel-facebook-messenger

ActiveLibrary

adolphyu/laravel-facebook-messenger
===================================

A Laravel Package to Integrate Facebook Messenger API

v0.1.4(5y ago)71192MITPHPPHP ^7.3

Since Sep 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/AdolphYu/laravel-facebook-messenger)[ Packagist](https://packagist.org/packages/adolphyu/laravel-facebook-messenger)[ RSS](/packages/adolphyu-laravel-facebook-messenger/feed)WikiDiscussions master Synced 1mo ago

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

Laravel Facebook Messenger
==========================

[](#laravel-facebook-messenger)

[![Codacy Badge](https://camo.githubusercontent.com/f892e0ef1076aed362ff1ea3d532de759c05e4140e4c384816be9725ff415adc/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3938316139653835373163653433646139633466383330376434643335323630)](https://app.codacy.com/manual/AdolphYu/laravel-facebook-messenger?utm_source=github.com&utm_medium=referral&utm_content=AdolphYu/laravel-facebook-messenger&utm_campaign=Badge_Grade_Dashboard)[![Build Status](https://camo.githubusercontent.com/a8a44c0bf6a9ff8196227746eda594adf6300d889c7d686d1e82491a268b5337/68747470733a2f2f6170692e7472617669732d63692e6f72672f41646f6c706859752f6c61726176656c2d66616365626f6f6b2d6d657373656e6765722e737667)](https://travis-ci.org/AdolphYu/laravel-facebook-messenger)[![Latest Stable Version](https://camo.githubusercontent.com/3b77be2ebd1a05c099b2daf21fa69f8a7d0bb42bb4107880e64f4067460127c8/68747470733a2f2f706f7365722e707567782e6f72672f61646f6c706879752f6c61726176656c2d66616365626f6f6b2d6d657373656e6765722f76)](//packagist.org/packages/adolphyu/laravel-facebook-messenger)[![Total Downloads](https://camo.githubusercontent.com/254e4f8d09e62398e4717f933c1c00fbecf656b6ed5d2de49a9602dd89b3bce0/68747470733a2f2f706f7365722e707567782e6f72672f61646f6c706879752f6c61726176656c2d66616365626f6f6b2d6d657373656e6765722f646f776e6c6f616473)](//packagist.org/packages/adolphyu/laravel-facebook-messenger)[![License](https://camo.githubusercontent.com/b00e4b03883078cc7e26c1a8e386bf0e1900e85f46148c693e7a6bbb735d56da/68747470733a2f2f706f7365722e707567782e6f72672f61646f6c706879752f6c61726176656c2d66616365626f6f6b2d6d657373656e6765722f6c6963656e7365)](//packagist.org/packages/adolphyu/laravel-facebook-messenger)

This is a laravel package for Facebook Messenger Platform API.

Easy to making your facebook messenger.

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

[](#installation)

### Composer

[](#composer)

```
composer require adolphyu/laravel-facebook-messenger
```

Laravel
-------

[](#laravel)

### Add Provider

[](#add-provider)

In your `config/app.php` add `AdolphYu\FBMessenger\PackageServiceProvider::class` to the providers array:

```
'providers' => [
    ...
    AdolphYu\FBMessenger\PackageServiceProvider::class,
    ...
],

'alias => [
    ...
    'FBMSG' => AdolphYu\FBMessenger\Facades\FBMSG::class,
    ...
],
```

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --provider="AdolphYu\FBMessenger\PackageServiceProvider" --tag="config"
```

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

[](#configuration)

### Security

[](#security)

Almost every API request with `access_token`, if you want to improved security in your app, you can use `appsecret_proof`. Please add `MESSENGER_APP_SECRET` to `.env` file and enable proof on all calls. *If you don't know how to get secret token and enabled proof, please checkout [Graph Api](https://developers.facebook.com/docs/graph-api/securing-requests)*

`.env`

```
MESSENGER_APP_SECRET="APP SECRET TOKEN"

```

### Token

[](#token)

Add you token to `.env` file or modify `fb-messenger.php` config.

*If you don't know how to get token, please checkout [Facebook Developer](https://developers.facebook.com/docs/messenger-platform/quickstart)*

`.env`

```
...
MESSENGER_VERIFY_TOKEN="By You Writing"
MESSENGER_APP_TOKEN="Page Access Token"
...

```

### Custom Url

[](#custom-url)

If you want to custom url, replace `/webhook` to you want.

Finally, you can run `php artisan route:list` to check.

```
 return [
     'verify_token' => env('MESSENGER_VERIFY_TOKEN'),
     'app_token' => env('MESSENGER_APP_TOKEN'),
     'custom_url' => '/chatbot', // like this
 ];
```

Receive Message
---------------

[](#receive-message)

### Processes

[](#processes)

The `Process` will process the information sent by facebook messenger

THe `Process` must implement `ProcessInterface` interface. There is a method `handle` in the `ProcessInterface` , which processes the information sent by facebook messenger

You can check out [ProcessInterface](https://github.com/AdolphYu/laravel-facebook-messenger/blob/master/src/Processes/ProcessInterface.php)

If you need to add or customize process, you must implement this interface

```
