PHP code example of mboretto / messenger-bot

1. Go to this page and download the library: Download mboretto/messenger-bot library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mboretto / messenger-bot example snippets



namespace MBoretto\MessengerBot\Middleware;
use \Closure;
use \MBoretto\MessengerBot\Objects\Messaging;

class BeforeGetUser extends Layer
{
    public function handle(Messaging $messaging, Closure $next)
    {
        //My routine
        return $next($messaging);
    }
}


namespace MBoretto\MessengerBot\Middleware;
use \Closure;
use \MBoretto\MessengerBot\Objects\Messaging;

class BeforeGetUser extends Layer
{
    public function handle(Messaging $messaging, Closure $next)
    {
        $messaging = $next($messaging);
        //My routine
        return $messaging;
    }
}