ryannielson / shareable
A Laravel 4 package to make it easy to add social sharing buttons to your application.
Installs: 2 757
Dependents: 0
Suggesters: 0
Security: 0
Stars: 22
Watchers: 6
Forks: 8
Open Issues: 0
Requires
- php: >=5.3.0
- illuminate/support: ~4.1
- illuminate/view: ~4.1
Requires (Dev)
- mockery/mockery: 0.9.*
- phpunit/phpunit: 4.0.*
This package is not auto-updated.
Last update: 2024-12-21 16:36:16 UTC
README
#shareable
A Laravel 4 package to make it easy to add social sharing buttons to your application.
This Laravel 4 package provides helpers for easily adding social sharing buttons to your views. This package includes support for:
- Google Plus
Installation
Run the following Composer command in your terminal, or simply add 'ryannielson/shareable': '1.0.*'
to your composer.json file:
composer require ryannielson/shareable:'1.0.*'
Once complete, you now have to add the the service provider to the providers array in app/config/app.php
:
'RyanNielson\Shareable\ShareableServiceProvider'
Finally, add the following entry entry to the aliases array in app/config/app.php
:
'Shareable' => 'RyanNielson\Shareable\Facades\Shareable'
That's it!
Usage
Shareable current supports only a few social networks, which are accessed through a similar Shareable facade which should be used in your views. Each of these methods can also be passed an array of options which correspond to the options shown on the respective button creation pages and listed below.
Render all share buttons, specified in the config.php (default all buttons), within a unordered list:
{{ Shareable::all() }}
developers.facebook.com/docs/plugins/share-button
{{ Shareable::facebook($options = array()) }}
Google Plus
developers.google.com/+/web/share
{{ Shareable::googlePlus($options = array()) }}
about.twitter.com/resources/buttons#tweet
{{ Shareable::twitter($options = array()) }}
View and Configuration Changes
Like most Laravel packages, you can edit the configuration and views for this package by running a few commands to put the files into your app's project directory.
Edit configuration: php artisan config:publish ryannielson/shareable
Edit views: php artisan view:publish ryannielson/shareable