tshafer / laravel-social-share
This package is abandoned and no longer maintained.
No replacement package was suggested.
1.0.0
2015-12-29 04:06 UTC
Requires
- php: >=5.5.9
- tshafer/laravel-service-provider: 1.0.*
This package is not auto-updated.
Last update: 2016-11-06 13:38:35 UTC
README
Installation
First, pull in the package through Composer.
composer require tshafer/laravel-social-share
And then, if using Laravel 5, include the service provider within app/config/app.php
.
'providers' => [ // ... Illuminate Providers // ... App Providers Tshafer\SocialShare\ServiceProvider::class ];
And, for convenience, add a facade alias to this same file at the bottom:
'aliases' => [ // ... Illuminate Facades 'Share' => Tshafer\SocialShare\Facades\SocialShare::class ];
Usage
Share::delicious(route('post.show', $post->id), $post->title, $post->thumbnail); Share::digg(route('post.show', $post->id), $post->title, $post->thumbnail); Share::evernote(route('post.show', $post->id), $post->title, $post->thumbnail); Share::facebook(route('post.show', $post->id), $post->title, $post->thumbnail); Share::gmail(route('post.show', $post->id), $post->title, $post->thumbnail); Share::googleplus(route('post.show', $post->id), $post->title, $post->thumbnail); Share::linkedin(route('post.show', $post->id), $post->title, $post->thumbnail); Share::pinterest(route('post.show', $post->id), $post->title, $post->thumbnail); Share::reddit(route('post.show', $post->id), $post->title, $post->thumbnail); Share::scoopit(route('post.show', $post->id), $post->title, $post->thumbnail); Share::springpad(route('post.show', $post->id), $post->title, $post->thumbnail); Share::tumblr(route('post.show', $post->id), $post->title, $post->thumbnail); Share::twitter(route('post.show', $post->id), $post->title, $post->thumbnail); Share::viadeo(route('post.show', $post->id), $post->title, $post->thumbnail); Share::vkcom(route('post.show', $post->id), $post->title, $post->thumbnail);
You can also dynamically get a url using the with()
method:
Share::with('twitter', route('post.show', $post->id), $post->title, $post->thumbnail);