You can install the package via composer:

composer require jorenvanhocht/laravel-share

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

// config/app.php
'providers' => [

And optionally add the facade in config/app.php

// config/app.php
'aliases' => [
    'Share' => Jorenvh\Share\ShareFacade::class,

Publish the package config & resource files.

php artisan vendor:publish --provider="Jorenvh\Share\Providers\ShareServiceProvider"

This will publish the laravel-share.php config file to your config folder, share.js in public/js/ and laravel-share.php in your resources/lang/vendor/en/ folder.


Since this package relies on Fontawesome, you will have to require it's css, js & fonts in your app. You can do that by requesting a embed code via their website or by installing it locally in your project.

Laravel share supports Font Awesome v4 and v5, by default v4 is used. You can specify the version you want to use in config/laravel-share.php


Load jquery.min.js & share.js by adding the following lines to your template files.

<script src=""></script>
<script src="{{ asset('js/share.js') }}"></script>


Creating one share link




Share::page('', 'Your share text can be placed here')->twitter();

Google Plus



Share::page('', 'Share title')->linkedin('Extra linkedin summary can be passed here')

Sharing the current url

Instead of manually passing an url, you can opt to use the currentPage function.


Creating multiple share Links

If want multiple share links for (multiple) providers you can just chain the methods like this.

Share::page('', 'Share title')
	->linkedin('Extra linkedin summary can be passed here');

This will generate the following html

<div id="social-links">
		<li><a href="" class="social-button " id=""><span class="fa fa-facebook-official"></span></a></li>
		<li><a href=" share text&amp;url=" class="social-button " id=""><span class="fa fa-twitter"></span></a></li>
		<li><a href="" class="social-button " id=""><span class="fa fa-google-plus"></span></a></li>
		<li><a href=";url=;title=my share text&amp;summary=dit is de linkedin summary" class="social-button " id=""><span class="fa fa-linkedin"></span></a></li>

Optional parameters

Add extra classes and id's to the social buttons

You can simply add extra class(es) or id('s) by passing an array as the third parameter on the page method.

Share::page('', null, ['class' => 'my-class', 'id' => 'my-id'])

Which will result in the following html

<div id="social-links">
		<li><a href="" class="social-button my-class" id="my-id"><span class="fa fa-facebook-official"></span></a></li>

Custom wrapping

By default social links will be wrapped in the following html

<div id="social-links">
		<!-- social links will be added here -->

This can be customised by passing the prefix & suffix as a parameter.

Share::page('', null, [], '<ul>', '</ul>')

This will output the following html.

	<li><a href="" class="social-button " id=""><span class="fa fa-facebook-official"></span></a></li>


Please see CHANGELOG for more information what has changed recently.


$ composer test


Please see CONTRIBUTING for details.


If you discover any security related issues, please email [email protected] instead of using the issue tracker.



The MIT License (MIT). Please see License File for more information.