PHP Developers Network
http://forums.devnetwork.net/

How to integrate facebook comments in a blog (laravel)
http://forums.devnetwork.net/viewtopic.php?f=72&t=143338
Page 1 of 1

Author:  gautamz07 [ Tue Feb 07, 2017 12:42 pm ]
Post subject:  How to integrate facebook comments in a blog (laravel)

Hey guys,

I want to use the comment plugin for my blog --> plugin https://developers.facebook.com/docs/plugins/comments/.

Now how do i associate each comment with a blog post ? i am using laravel, I am not quite sure.

If it were a static site i can just drop the plugin code and BLAM !!

But in my blog i would like the comments to be associated with my blog post , So how do i acheive this ??

Thank you.
Gautam.

Author:  Celauran [ Tue Feb 07, 2017 12:57 pm ]
Post subject:  Re: How to integrate facebook comments in a blog (laravel)

At a glance, it looks like you just need to update the data-href in your fb-comments div, so you could generate that when you render the view.

Author:  gautamz07 [ Tue Feb 07, 2017 2:13 pm ]
Post subject:  Re: How to integrate facebook comments in a blog (laravel)

I'll try it Thanks ! :)

Author:  gautamz07 [ Tue Feb 07, 2017 2:30 pm ]
Post subject:  Re: How to integrate facebook comments in a blog (laravel)

DANM !! worked .. basically just did the following in laravel for it to work::

Syntax: [ Download ] [ Hide ]
<div class="fb-comments" data-href="http://myblog.net/{{ $article->slug }}" data-width="500" data-numposts="5"></div>
 

Author:  Celauran [ Tue Feb 07, 2017 2:40 pm ]
Post subject:  Re: How to integrate facebook comments in a blog (laravel)

Don't hardcode the URL.

https://laravel.com/docs/5.4/helpers#method-route
https://laravel.com/docs/5.4/helpers#method-url

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/