PHPackages                             tapp/filament-social-share - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tapp/filament-social-share

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tapp/filament-social-share
==========================

Share a URL in social media platforms, email, or copy the URL

v1.0.1(3mo ago)81.4k4[2 PRs](https://github.com/TappNetwork/filament-social-share/pulls)MITPHPPHP ^8.2CI passing

Since Jul 29Pushed 1mo agoCompare

[ Source](https://github.com/TappNetwork/filament-social-share)[ Packagist](https://packagist.org/packages/tapp/filament-social-share)[ Docs](https://github.com/tapp/filament-social-share)[ GitHub Sponsors](https://github.com/TappNetwork)[ RSS](/packages/tapp-filament-social-share/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (13)Versions (5)Used By (0)

Filament Social Share
=====================

[](#filament-social-share)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7388b653e8377d517a8152e803875be37ce90411c28492285c2306ebfc8ab09b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746170702f66696c616d656e742d736f6369616c2d73686172652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/TappNetwork/filament-social-share)[![GitHub Tests Action Status](https://camo.githubusercontent.com/7e6c5106616d47e2f8dcfd972eeaca72ba2ce23c828e163417411b2ac7aebcec/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f546170704e6574776f726b2f66696c616d656e742d736f6369616c2d73686172652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/TappNetwork/filament-social-share/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://github.com/TappNetwork/filament-social-share/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](https://github.com/TappNetwork/filament-social-share/actions/workflows/fix-php-code-style-issues.yml/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/924aa95b9d217f25c034cf69d577ef7e148a671f2e1fa645800125ef56f5d192/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746170702f66696c616d656e742d736f6369616c2d73686172652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/TappNetwork/filament-social-share)

An action that allows users to share the current URL (or provide a custom one) on social media platforms, through email, or copy the link. It could be also used the web share API (supported by certain browsers).

Important

The web share API and copy to clipboard require HTTPs to work.

Appareance
----------

[](#appareance)

[![Action button](https://camo.githubusercontent.com/dc19225910d57454d6cb2570001cc56103aa9914799c9e18216bb9249aa6eff6/68747470733a2f2f7261772e6769746875622e636f6d2f546170704e6574776f726b2f66696c616d656e742d736f6369616c2d73686172652f6d61696e2f646f63732f627574746f6e2e706e67)](https://camo.githubusercontent.com/dc19225910d57454d6cb2570001cc56103aa9914799c9e18216bb9249aa6eff6/68747470733a2f2f7261772e6769746875622e636f6d2f546170704e6574776f726b2f66696c616d656e742d736f6369616c2d73686172652f6d61696e2f646f63732f627574746f6e2e706e67)

[![Modal](https://camo.githubusercontent.com/243b7fd1b565cb5f71ea7137334658c70b8ed8329fc9c502e387ee0527f26e69/68747470733a2f2f7261772e6769746875622e636f6d2f546170704e6574776f726b2f66696c616d656e742d736f6369616c2d73686172652f6d61696e2f646f63732f6d6f64616c2e706e67)](https://camo.githubusercontent.com/243b7fd1b565cb5f71ea7137334658c70b8ed8329fc9c502e387ee0527f26e69/68747470733a2f2f7261772e6769746875622e636f6d2f546170704e6574776f726b2f66696c616d656e742d736f6369616c2d73686172652f6d61696e2f646f63732f6d6f64616c2e706e67)

Dependencies
------------

[](#dependencies)

- owenvoke/blade-fontawesome for default social icons

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tapp/filament-social-share
```

You can publish the config using:

```
php artisan vendor:publish --tag="filament-social-share-config"
```

This is the contents of the published config file:

```
return [

    'action' => [
        'icon' => 'heroicon-m-share',
    ],

];
```

To apply the plugin styles, add to the your Filament `theme.css` file:

```
@source '../../../../vendor/tapp/filament-social-share';
```

Usage
-----

[](#usage)

The share action can open the native browser share or a Filament modal with options to share on X, Facebook, Linkedin, Reddit, or Email.

**Using Native Browser Web Share API**

Add the `->nativeBrowserShare()` to display the native browser share:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->nativeBrowserShare()
```

**Using modal with social plataform options**

When `->nativeBrowserShare()` is not provided a modal will be opened with options to share on social plataforms or email. The social plataforms available are in the example below:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->x()
    ->facebook()
    ->linkedin()
    ->reddit()
    ->email()
```

### Options available

[](#options-available)

Below you can see all the options available to the `SocialShareAction`.

Note

Any icon supported by Blade UI kit can be used for the social share icons.

### URL to Share

[](#url-to-share)

Default is current URL.

Provide a custom URL to share:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->urlToShare('https://github.com/TappNetwork/filament-social-share')
```

### Text

[](#text)

Default is the title.

Provide the text to share:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->text('Social Share Filament Plugin')
```

### Twitter/X

[](#twitterx)

To add X share button, add the x method providing the user:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->x()

// With custom icon, tooltip, and color
SocialShareAction::make()
    ->x(
        enabled: true,
        icon: 'fab-x',
        tooltip: 'Share on X',
        color: '#000000'
    )

// Using dedicated methods
SocialShareAction::make()
    ->x()
    ->xIcon('fab-x')
    ->xTooltip('Share this post on X')
    ->xColor('#000000')
```

### Facebook

[](#facebook)

To add Facebook share button:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->facebook()

// With custom icon, tooltip, and color
SocialShareAction::make()
    ->facebook(
        enabled: true,
        icon: 'fab-facebook-f',
        tooltip: 'Share on Facebook',
        color: '#1877f2'
    )

// Using dedicated methods
SocialShareAction::make()
    ->facebook()
    ->facebookIcon('fab-facebook-f')
    ->facebookTooltip('Share this post on Facebook')
    ->facebookColor('#1877f2')
```

### LinkedIn

[](#linkedin)

To add LinkedIn share button:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->linkedin()

// With custom icon, tooltip, and color
SocialShareAction::make()
    ->linkedin(
        enabled: true,
        icon: 'fab-linkedin-in',
        tooltip: 'Share on LinkedIn',
        color: '#0077b5'
    )

// Using dedicated methods
SocialShareAction::make()
    ->linkedin()
    ->linkedinIcon('fab-linkedin-in')
    ->linkedinTooltip('Share on LinkedIn network')
    ->linkedinColor('#0077b5')
```

### Reddit

[](#reddit)

To add Reddit share button:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->reddit()

// With custom icon, tooltip, and color
SocialShareAction::make()
    ->reddit(
        enabled: true,
        icon: 'fab-reddit-alien',
        tooltip: 'Share on Reddit',
        color: '#ff4500'
    )

// Using dedicated methods
SocialShareAction::make()
    ->reddit()
    ->redditIcon('fab-reddit-alien')
    ->redditTooltip('Post to Reddit')
    ->redditColor('#ff4500')
```

### Email

[](#email)

To add Email share button:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->email()

// With custom icon, tooltip, and color
SocialShareAction::make()
    ->email(
        enabled: true,
        icon: 'heroicon-o-envelope',
        tooltip: 'Share via Email',
        color: '#6b7280'
    )

// Using dedicated methods
SocialShareAction::make()
    ->email()
    ->emailIcon('heroicon-o-envelope')
    ->emailTooltip('Send via Email')
    ->emailColor('#6b7280')
```

### Native Browser Share

[](#native-browser-share)

Enable native browser Web Share API:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->nativeBrowserShare()
```

### Process Customization

[](#process-customization)

Add custom logic before or after the sharing process:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;
use Filament\Notifications\Notification;

SocialShareAction::make()
    ->before(function () {
        // Execute before sharing modal opens
        Notification::make()
            ->title('Opening share options...')
            ->info()
            ->send();
    })
    ->after(function () {
        // Execute after sharing process
        \Log::info('User opened social share modal');
    })
    ->facebook()
    ->linkedin()
```

### Default Colors

[](#default-colors)

The plugin comes with sensible default colors for each platform:

- **X (Twitter)**: `#000000` (Black)
- **Facebook**: `#3b82f6` (Blue)
- **LinkedIn**: `#1d4ed8` (Dark Blue)
- **Reddit**: `#ea580c` (Orange)
- **Email**: `#000000` (Black)

### Different Approaches to Define Configurations

[](#different-approaches-to-define-configurations)

Using named parameters in main social plataform method

```
SocialShareAction::make()
    ->facebook(
        enabled: true,
        icon: 'fab-facebook-f',
        tooltip: 'Share this post on Facebook',
        color: '#1877f2'
    )
    ->linkedin(
        icon: 'fab-linkedin-in',
        color: '#0077b5',
        tooltip: 'Share on LinkedIn network'
    )
    ->reddit(
        color: '#ff4500',
        tooltip: 'Post to Reddit'
    )
```

Using pure dedicated methods

```
SocialShareAction::make()
    ->facebook()
        ->facebookIcon('fab-facebook-f')
        ->facebookTooltip('Share this amazing post on Facebook')
        ->facebookColor('#1877f2')
    ->linkedin()
        ->linkedinColor('#0077b5')
        ->linkedinTooltip('Share on LinkedIn network')
    ->reddit()
        ->redditColor('#ff4500')
```

Mixed approach (Maximum Flexibility)

```
SocialShareAction::make()
    ->facebook(icon: 'fab-facebook-f')  // Named parameter for icon
        ->facebookTooltip('Custom tooltip')  // Dedicated method for tooltip
        ->facebookColor('#1877f2')           // Dedicated method for color
    ->linkedin(color: '#0077b5')        // Named parameter for color
        ->linkedinIcon('fab-linkedin-in')    // Dedicated method for icon
    ->reddit()                          // Enable with all defaults
        ->redditColor('#ff4500')
```

Conditional/Dynamic Configuration

```
$action = SocialShareAction::make()
    ->facebook()
    ->linkedin();

// Conditionally customize based on user preferences
if ($user->prefers_custom_colors) {
    $action->facebookColor('#custom-color')
           ->linkedinColor('#another-color');
}

if ($user->is_premium) {
    $action->reddit()
           ->redditTooltip('Premium user sharing');
}
```

### Customizing the action

[](#customizing-the-action)

Any method available to Filament action can be used, for example, to use an icon instead of button for share action:

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

 SocialShareAction::make()
    ->facebook()
    ->iconButton(),
```

### Executing code before or after the action

[](#executing-code-before-or-after-the-action)

The `before()` and `after()` methods could be used to execute some extra logic before or after the action:

- **before()** - Runs code before the main sharing action occurs.
- **after()** - Runs code after the sharing modal is displayed/processed.

Example: Send Notification After Sharing

```
use Filament\Notifications\Notification;
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->facebook()
    ->linkedin()
    ->after(function () {
        // Send notification after user opens share modal
        Notification::make()
            ->title('Share options displayed')
            ->body('The social sharing options have been presented to the user.')
            ->success()
            ->send();
    }),
```

Example: Log Sharing Activity

```
use Illuminate\Support\Facades\Log;
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->facebook()
    ->linkedin()
    ->before(function () {
        // Log that user initiated sharing
        Log::info('User opened social share modal', [
            'user_id' => auth()->id(),
            'timestamp' => now(),
            'url' => request()->url()
        ]);
    })
    ->after(function () {
        // Log completion
        Log::info('Social share modal displayed successfully');
    })
```

Example: Custom Authorization Check

```
use Filament\Notifications\Notification;
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->facebook()
    ->linkedin()
    ->before(function () {
        // Check if user has permission to share
        if (!auth()->user()->can('share_content')) {
            Notification::make()
                ->title('Permission Denied')
                ->body('You do not have permission to share content.')
                ->danger()
                ->send();

            throw new \Exception('Unauthorized sharing attempt');
        }
    })
```

Example: Track Analytics

```
use Tapp\FilamentSocialShare\Actions\SocialShareAction;

SocialShareAction::make()
    ->facebook()
    ->linkedin()
    ->before(function () {
        // Track sharing intent in analytics
        event('social_share_initiated', [
            'user_id' => auth()->id(),
            'content_type' => 'article',
            'content_id' => request()->route('id')
        ]);
    })
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Tapp Network](https://github.com/TappNetwork)
- [All Contributors](../../contributors)

Inspired by [PenguinUI](https://www.penguinui.com/ai-components/output-interactions).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance85

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~176 days

Total

2

Last Release

110d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d72a8c345b7f4205dc1edaff8d05ce78f7fe1ec93dce0e52d29f18e885508d4f?d=identicon)[tapp](/maintainers/tapp)

![](https://www.gravatar.com/avatar/4c469e4e441a135287b2154a0a39f543893cbe1e2c3ab066e3e7c66a974a39e2?d=identicon)[scottgrayson](/maintainers/scottgrayson)

![](https://www.gravatar.com/avatar/5d0402fb770bca016dd6ee6a925501e0224783f1e5907788aee0ba7bc31c01ee?d=identicon)[andreiabohner](/maintainers/andreiabohner)

![](https://www.gravatar.com/avatar/5ac72d31fcf96191b82f452d6df6990219c5ffdfd7673859d3fa46cf1dd6193b?d=identicon)[johnwesely](/maintainers/johnwesely)

---

Top Contributors

[![andreia](https://avatars.githubusercontent.com/u/38911?v=4)](https://github.com/andreia "andreia (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![EG-Mohamed](https://avatars.githubusercontent.com/u/23424932?v=4)](https://github.com/EG-Mohamed "EG-Mohamed (1 commits)")[![kaungkhantjc](https://avatars.githubusercontent.com/u/58139120?v=4)](https://github.com/kaungkhantjc "kaungkhantjc (1 commits)")

---

Tags

laravelfilamentsocial share linkssocial-sharefilament-social-share

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tapp-filament-social-share/health.svg)

```
[![Health](https://phpackages.com/badges/tapp-filament-social-share/health.svg)](https://phpackages.com/packages/tapp-filament-social-share)
```

###  Alternatives

[pboivin/filament-peek

Full-screen page preview modal for Filament

253319.6k12](/packages/pboivin-filament-peek)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

124139.3k2](/packages/dotswan-filament-map-picker)[creagia/filament-code-field

A Filamentphp input field to edit or view code data.

58289.3k3](/packages/creagia-filament-code-field)[jibaymcs/filament-tour

Bring the power of DriverJs to your Filament panels and start a tour !

12247.8k](/packages/jibaymcs-filament-tour)[aymanalhattami/filament-context-menu

context menu (right click menu) for filament

9838.0k](/packages/aymanalhattami-filament-context-menu)[schmeits/filament-character-counter

This is a Filament character counter TextField and Textarea form field for Filament v4 and v5

33184.7k6](/packages/schmeits-filament-character-counter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
