Laravel – social media share buttons with custom content


How can I customize the content display when I share a page on facebook or google plus. title, description, image..etc.. When I share my page now on facebook, it adds a certain image and title other the required. In case of google plus, image is shared correctly but still the title is not the one I need.
Here's how I currently use them:

<a href="" target="_blank"></a>

<!-- Google+ -->
<a href="" target="_blank"></a>

Any idea how can I customize it to my need or if there is any packages that could support me as well. Also, do I need to create an app on facebook or google plus in order to do so. I'm just using share button.

Best Solution

something like this for facebook share

<meta property="og:title" content="title here" />
<meta property="og:image" content="image url here" />
<meta property="og:type" content="website" />

debug your page first on facebook using to clear facebook cache on your site

you don't have to create app on facebook to use share button, i think it's same with gplus but i'm not sure.

or create this page as a target url to share

    $title = 'title';
    $image = 'image';
<meta property="og:title" content="{{$title}}" />
<meta property="og:image" content="{{$image}}" />
<meta property="og:type" content="website" />
    window.location = "http://www.url-to-real-shared-page";
Related Question