Reputation: 113
I am trying to implement facebook instant article in laravel application anyone guide me how can i implement this
I also found a package on GitHub enter link description here
but I don't know where to paste this code in laravel files
require_once('vendor/autoload.php');
Upvotes: 1
Views: 1788
Reputation: 1800
if you're using laravel and you've downloaded facebook SDK with composer, you don't have to paste this code anywhere. You can start using SDK already and import your articles
use Facebook\InstantArticles\Client\Client;
// Instantiate an API client
$ia_client = Client::create(
'APP_ID',
'APP_SECRET',
'ACCESS_TOKEN',
'PAGE_ID'
);
// Push the article to your Facebook Page
$ia_client->importArticle($my_article);
https://developers.facebook.com/docs/instant-articles/sdk/integration
Upvotes: 2