Easy Social Share Cards for Your Laravel App
Installation
First, pull in the package through Composer., (*1)
composer require setkyar/laravel-social-share-cards
And then, if using Laravel 5, include the service provider within config/app.php., (*2)
'providers' => [
SetKyar\Social\SocialServiceProvider::class,
];
Run php artisan vendor:publish to get config of Laravel social share config., (*3)
Usage
Setup FB APP ID and your site's twitter account in social.php config. (Those are optional), (*4)
fb_app_id
twitter_site
Include meta-article in the head tag with title, description, and image which you want to appear on Facebook, Twitter and Google+ ., (*5)
title, description, and image must fill! author is
optional!, (*6)
@include('social::meta-article', [
'title' => 'Hello World',
'description' => 'Welcome from Hello World',
'image' => 'http://static01.nyt.com/images/2015/02/19/arts/international/19iht-btnumbers19A/19iht-btnumbers19A-facebookJumbo-v2.jpg',
'author' => 'Set Kyar Wa Lar'
])
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
@include('social::meta-article', [
'title' => 'Hello World',
'description' => 'Welcome from Hello World',
'image' => 'http://static01.nyt.com/images/2015/02/19/arts/international/19iht-btnumbers19A/19iht-btnumbers19A-facebookJumbo-v2.jpg',
'author' => 'Set Kyar Wa Lar'
])
<title>Document</title>
</head>
<body>
</body>
</html>
Example Appearance
Facebook Appearance
, (*7)
, (*8)
Google+ Appearance
, (*9)
Contributing
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Added some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
Thanks