wotz/laravel-social-media-share

A Laravel package for social sharing. This package is a rewrite from jorenvanhocht/laravel-share.

Installs: 36

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 2

pkg:composer/wotz/laravel-social-media-share

v4.0.0 2026-01-20 20:40 UTC

README

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.