Skip to content

Instantly share code, notes, and snippets.

@setkyar
Last active June 19, 2016 04:50
Show Gist options
  • Save setkyar/5766ccdb1942e01390564209e6cb30d3 to your computer and use it in GitHub Desktop.
Save setkyar/5766ccdb1942e01390564209e6cb30d3 to your computer and use it in GitHub Desktop.
Laravel Social Share Helper
<?php
function createFacebookShare($url, $title)
{
return '
<a href="http://www.facebook.com/share.php?u='. $url .'&title='. $title .'"><i class="fa fa-facebook-square"></i> SHARE</a>
';
}
function createTwitterShare($url, $title)
{
return '
<a href="http://twitter.com/intent/tweet?status=' . $title . '+'. $url .'"><i class="fa fa-twitter-square"></i> TWEET</a>
';
}
function createPinterestShare($url, $title, $media)
{
return '
<a href="http://pinterest.com/pin/create/bookmarklet/?media='. $media.'&url='. $url .'&is_video=false&description='. $title .'"><i class="fa fa-pinterest-square"></i> PIN</a>
';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment