Download the PHP package tapp/filament-social-share without Composer
On this page you can find all versions of the php package tapp/filament-social-share. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tapp/filament-social-share
More information about tapp/filament-social-share
Files in tapp/filament-social-share
Package filament-social-share
Short Description Share a URL in social media platforms, email, or copy the URL
License MIT
Homepage https://github.com/tapp/filament-social-share
Informations about the package filament-social-share
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


Dependencies
- owenvoke/blade-fontawesome for default social icons
Installation
You can install the package via composer:
You can publish the config using:
This is the contents of the published config file:
To apply the plugin styles, add to the your Filament theme.css file:
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:
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:
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
Default is current URL.
Provide a custom URL to share:
Text
Default is the title.
Provide the text to share:
Twitter/X
To add X share button, add the x method providing the user:
To add Facebook share button:
To add LinkedIn share button:
To add Reddit share button:
To add Email share button:
Native Browser Share
Enable native browser Web Share API:
Process Customization
Add custom logic before or after the sharing process:
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
Using named parameters in main social plataform method
Using pure dedicated methods
Mixed approach (Maximum Flexibility)
Conditional/Dynamic Configuration
Customizing the action
Any method available to Filament action can be used, for example, to use an icon instead of button for share 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
Example: Log Sharing Activity
Example: Custom Authorization Check
Example: Track Analytics
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Tapp Network
- All Contributors
Inspired by PenguinUI.
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-social-share with dependencies
filament/filament Version ^5.0|^4.0
owenvoke/blade-fontawesome Version ^2.9
spatie/laravel-package-tools Version ^1.15.0