setkyar / laravel-social-share-cards
Easy Social Cards
Installs: 2 055
Dependents: 0
Suggesters: 0
Security: 0
Stars: 49
Watchers: 6
Forks: 5
Open Issues: 0
Language:HTML
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0
This package is auto-updated.
Last update: 2023-01-20 10:21:30 UTC
README
Installation
First, pull in the package through Composer.
composer require setkyar/laravel-social-share-cards
And then, if using Laravel 5, include the service provider within config/app.php
.
'providers' => [
SetKyar\Social\SocialServiceProvider::class,
];
Run php artisan vendor:publish
to get config of Laravel social share config.
Usage
Setup FB APP ID and your site's twitter account in social.php
config. (Those are optional)
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+ .
title
,description
, andimage
must fill!author
is optional!
@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
Twitter Appearance
Google+ Appearance
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
- Thanks Jeffrey Way for laracast flash, POVILAS KOROP for this tutorial and Philip Brown for this tutorial :)