Looking to hire Laravel developers? Try LaraJobs

laravel-social-media-share maintained by wotz

Description
A Laravel package for social sharing. This package is a rewrite from jorenvanhocht/laravel-share.
Last update
2026/03/20 09:26 (dev-copilot/update-package-php-8-5-laravel-13)
License
Downloads
634

Comments
comments powered by Disqus

Laravel Social Media Share

Software License

This package allows you to drop a social media links component on any page in your application. It can be used using Font Awesome and some default css or renderless without any styling and dependencies using SVG's. This package is heavily inspired by the jorenvanhocht/laravel-share package.

Installation

You can install the package via composer:

composer require wotz/laravel-social-media-share

Publish the package config & resource files.

php artisan vendor:publish --tag=codedor-social-media-share

Usage

Add the following line to any blade template where you want the social media links to appear.

<x-social-media-share-share
    :title="$model->title"
    :summary="$model->intro"
/>

To pull in the CSS add this line to the bottom of your HEAD tag in your default.blade.php file

@stack('head')

To pull in the javascript add this line right before the closing BODY tag in your default.blade.php file

@stack('scripts')

This generates:

<div id="js-social-media-share" class="social-media">
    <ul class="social-media-share">
        <li>
            <a class="js-social-media-share" href="https://www.facebook.com/sharer/sharer.php?u=https://example.com/your-page">
                <i class="fab fa-lg fa-facebook-square"></i>
            </a>
        </li>
        <li>
            <a class="js-social-media-share" href="http://www.linkedin.com/shareArticle?mini=true&title=pageTitle&summary=pageSummary&url=https://example.com/your-page">
                <i class="fab fa-lg fa-linkedin-square"></i>
            </a>
        </li>
        <li>
            <a class="js-social-media-share" href="https://twitter.com/intent/tweet?text=pageTitle&url=https://example.com/your-page">
                <i class="fab fa-lg fa-twitter-square"></i>
            </a>
        </li>
    </ul>
</div>

Documentation

For the full documentation, check here.

Testing

vendor/bin/pest

Changelog

Please see CHANGELOG for more information on what has changed recently.

Upgrading

Please see UPGRADING for more information on how to upgrade to a new version.