Skip to content

Instantly share code, notes, and snippets.

@hamzahjamad
Last active December 24, 2017 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamzahjamad/5dccd1415e207ad67a7ece6b1311d715 to your computer and use it in GitHub Desktop.
Save hamzahjamad/5dccd1415e207ad67a7ece6b1311d715 to your computer and use it in GitHub Desktop.
<?php
// fb-bot-tutorial/app/Http/Controllers/WebhookController.php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class WebhookController extends Controller
{
// this will verify the Facebook Messenger with our Laravel project
public function getWebhook(Request $request)
{
//TODO
}
//whenever Facebook Messenger get message from the user,
//Facebook Messenger will send to our Laravel project here
public function postWebhook(Request $request)
{
//TODO
}
//after we process the message on above, let send message to the user
//back in Facebook Messenger
protected function sendToFbMessenger($sender, $message)
{
//TODO
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment