{"id":29843320,"url":"https://github.com/tappnetwork/filament-social-share","last_synced_at":"2025-07-29T15:42:58.198Z","repository":{"id":307016000,"uuid":"1027977807","full_name":"TappNetwork/filament-social-share","owner":"TappNetwork","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-29T01:34:06.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-29T01:41:53.237Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TappNetwork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"TappNetwork"}},"created_at":"2025-07-28T20:37:01.000Z","updated_at":"2025-07-29T01:34:11.000Z","dependencies_parsed_at":"2025-07-29T01:42:21.255Z","dependency_job_id":"d6c958e3-b5a5-4d5b-8bfe-10ec83a1e13a","html_url":"https://github.com/TappNetwork/filament-social-share","commit_stats":null,"previous_names":["tappnetwork/filament-social-share"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TappNetwork/filament-social-share","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Ffilament-social-share","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Ffilament-social-share/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Ffilament-social-share/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Ffilament-social-share/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TappNetwork","download_url":"https://codeload.github.com/TappNetwork/filament-social-share/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Ffilament-social-share/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267710239,"owners_count":24131936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-29T15:42:57.684Z","updated_at":"2025-07-29T15:42:58.180Z","avatar_url":"https://github.com/TappNetwork.png","language":"PHP","funding_links":["https://github.com/sponsors/TappNetwork"],"categories":[],"sub_categories":[],"readme":"# Filament Social Share\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/tapp/filament-social-share.svg?style=flat-square)](https://packagist.org/packages/TappNetwork/filament-social-share)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/TappNetwork/filament-social-share/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/TappNetwork/filament-social-share/actions?query=workflow%3Arun-tests+branch%3Amain)\n![GitHub Code Style Action Status](https://github.com/TappNetwork/filament-social-share/actions/workflows/fix-php-code-style-issues.yml/badge.svg)\n[![Total Downloads](https://img.shields.io/packagist/dt/tapp/filament-social-share.svg?style=flat-square)](https://packagist.org/packages/TappNetwork/filament-social-share)\n\nAn 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).\n\n\u003e [!IMPORTANT]  \n\u003e The web share API and copy to clipboard require HTTPs to work.\n\n## Appareance\n\n![Action button](https://raw.github.com/TappNetwork/filament-social-share/main/docs/button.png)\n\n![Modal](https://raw.github.com/TappNetwork/filament-social-share/main/docs/modal.png)\n\n## Dependencies\n\n- owenvoke/blade-fontawesome for default social icons\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require tapp/filament-social-share\n```\n\nYou can publish the config using:\n\n```bash\nphp artisan vendor:publish --tag=\"filament-social-share-config\"\n```\n\nThis is the contents of the published config file:\n\n```php\nreturn [\n\n    'action' =\u003e [\n        'icon' =\u003e 'heroicon-m-share',\n    ],\n\n];\n```\n\nTo apply the plugin styles, add to the your Filament `theme.css` file:\n\n```css\n@source '../../../../vendor/tapp/filament-social-share';\n```\n\n## Usage\n\nThe share action can open the native browser share or a Filament modal with options to share on X, Facebook, Linkedin, Reddit, or Email.\n\n**Using Native Browser Web Share API**\n\nAdd the `-\u003enativeBrowserShare()` to display the native browser share:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003enativeBrowserShare()\n```\n\n**Using modal with social plataform options**\n\nWhen `-\u003enativeBrowserShare()` 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:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003ex()\n    -\u003efacebook()\n    -\u003elinkedin()\n    -\u003ereddit()\n    -\u003eemail()\n```\n\n### Options available\n\nBelow you can see all the options available to the `SocialShareAction`.\n\n\u003e [!NOTE]  \n\u003e Any icon supported by Blade UI kit can be used for the social share icons.\n\n### URL to Share\n\nDefault is current URL.\n\nProvide a custom URL to share:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003eurlToShare('https://github.com/TappNetwork/filament-social-share')\n```\n\n### Text\n\nDefault is the title.\n\nProvide the text to share:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003etext('Social Share Filament Plugin')\n```\n\n### Twitter/X\n\nTo add X share button, add the x method providing the user:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003ex()\n\n// With custom icon, tooltip, and color\nSocialShareAction::make()\n    -\u003ex(\n        enabled: true,\n        icon: 'fab-x',\n        tooltip: 'Share on X',\n        color: '#000000'\n    )\n    \n// Using dedicated methods\nSocialShareAction::make()\n    -\u003ex()\n    -\u003exIcon('fab-x')\n    -\u003exTooltip('Share this post on X')\n    -\u003exColor('#000000')\n```\n\n### Facebook\n\nTo add Facebook share button:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003efacebook()\n    \n// With custom icon, tooltip, and color\nSocialShareAction::make()\n    -\u003efacebook(\n        enabled: true,\n        icon: 'fab-facebook-f',\n        tooltip: 'Share on Facebook',\n        color: '#1877f2'\n    )\n    \n// Using dedicated methods\nSocialShareAction::make()\n    -\u003efacebook()\n    -\u003efacebookIcon('fab-facebook-f')\n    -\u003efacebookTooltip('Share this post on Facebook')\n    -\u003efacebookColor('#1877f2')\n```\n\n### LinkedIn\n\nTo add LinkedIn share button:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003elinkedin()\n    \n// With custom icon, tooltip, and color\nSocialShareAction::make()\n    -\u003elinkedin(\n        enabled: true,\n        icon: 'fab-linkedin-in',\n        tooltip: 'Share on LinkedIn',\n        color: '#0077b5'\n    )\n    \n// Using dedicated methods\nSocialShareAction::make()\n    -\u003elinkedin()\n    -\u003elinkedinIcon('fab-linkedin-in')\n    -\u003elinkedinTooltip('Share on LinkedIn network')\n    -\u003elinkedinColor('#0077b5')\n```\n\n### Reddit\n\nTo add Reddit share button:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003ereddit()\n    \n// With custom icon, tooltip, and color\nSocialShareAction::make()\n    -\u003ereddit(\n        enabled: true,\n        icon: 'fab-reddit-alien',\n        tooltip: 'Share on Reddit',\n        color: '#ff4500'\n    )\n    \n// Using dedicated methods\nSocialShareAction::make()\n    -\u003ereddit()\n    -\u003eredditIcon('fab-reddit-alien')\n    -\u003eredditTooltip('Post to Reddit')\n    -\u003eredditColor('#ff4500')\n```\n\n### Email\n\nTo add Email share button:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003eemail()\n    \n// With custom icon, tooltip, and color\nSocialShareAction::make()\n    -\u003eemail(\n        enabled: true,\n        icon: 'heroicon-o-envelope',\n        tooltip: 'Share via Email',\n        color: '#6b7280'\n    )\n    \n// Using dedicated methods\nSocialShareAction::make()\n    -\u003eemail()\n    -\u003eemailIcon('heroicon-o-envelope')\n    -\u003eemailTooltip('Send via Email')\n    -\u003eemailColor('#6b7280')\n```\n\n### Native Browser Share\n\nEnable native browser Web Share API:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003enativeBrowserShare()\n```\n\n### Process Customization\n\nAdd custom logic before or after the sharing process:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\nuse Filament\\Notifications\\Notification;\n\nSocialShareAction::make()\n    -\u003ebefore(function () {\n        // Execute before sharing modal opens\n        Notification::make()\n            -\u003etitle('Opening share options...')\n            -\u003einfo()\n            -\u003esend();\n    })\n    -\u003eafter(function () {\n        // Execute after sharing process\n        \\Log::info('User opened social share modal');\n    })\n    -\u003efacebook()\n    -\u003elinkedin()\n```\n\n### Default Colors\n\nThe plugin comes with sensible default colors for each platform:\n\n- **X (Twitter)**: `#000000` (Black)\n- **Facebook**: `#3b82f6` (Blue)\n- **LinkedIn**: `#1d4ed8` (Dark Blue)\n- **Reddit**: `#ea580c` (Orange)\n- **Email**: `#000000` (Black)\n\n### Different Approaches to Define Configurations\n\nUsing named parameters in main social plataform method\n\n```php\nSocialShareAction::make()\n    -\u003efacebook(\n        enabled: true,\n        icon: 'fab-facebook-f', \n        tooltip: 'Share this post on Facebook',\n        color: '#1877f2'\n    )\n    -\u003elinkedin(\n        icon: 'fab-linkedin-in',\n        color: '#0077b5',\n        tooltip: 'Share on LinkedIn network'\n    )\n    -\u003ereddit(\n        color: '#ff4500',\n        tooltip: 'Post to Reddit'\n    )\n```\n\nUsing pure dedicated methods\n\n```php\nSocialShareAction::make()\n    -\u003efacebook()\n        -\u003efacebookIcon('fab-facebook-f')\n        -\u003efacebookTooltip('Share this amazing post on Facebook')\n        -\u003efacebookColor('#1877f2')\n    -\u003elinkedin()\n        -\u003elinkedinColor('#0077b5')\n        -\u003elinkedinTooltip('Share on LinkedIn network')\n    -\u003ereddit()\n        -\u003eredditColor('#ff4500')\n```\n\nMixed approach (Maximum Flexibility)\n\n```php\nSocialShareAction::make()\n    -\u003efacebook(icon: 'fab-facebook-f')  // Named parameter for icon\n        -\u003efacebookTooltip('Custom tooltip')  // Dedicated method for tooltip\n        -\u003efacebookColor('#1877f2')           // Dedicated method for color\n    -\u003elinkedin(color: '#0077b5')        // Named parameter for color\n        -\u003elinkedinIcon('fab-linkedin-in')    // Dedicated method for icon\n    -\u003ereddit()                          // Enable with all defaults\n        -\u003eredditColor('#ff4500')     \n```\n\nConditional/Dynamic Configuration\n\n```php\n$action = SocialShareAction::make()\n    -\u003efacebook()\n    -\u003elinkedin();\n\n// Conditionally customize based on user preferences\nif ($user-\u003eprefers_custom_colors) {\n    $action-\u003efacebookColor('#custom-color')\n           -\u003elinkedinColor('#another-color');\n}\n\nif ($user-\u003eis_premium) {\n    $action-\u003ereddit()\n           -\u003eredditTooltip('Premium user sharing');\n}\n```\n\n### Customizing the action\n\nAny method available to Filament action can be used, for example, to use an icon instead of button for share action:\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\n SocialShareAction::make()\n    -\u003efacebook()\n    -\u003eiconButton(),\n```\n\n### Executing code before or after the action\n\nThe `before()` and `after()` methods could be used to execute some extra logic before or after the action:\n\n- **before()** - Runs code before the main sharing action occurs.\n\n- **after()** - Runs code after the sharing modal is displayed/processed.\n\nExample: Send Notification After Sharing\n\n```php\nuse Filament\\Notifications\\Notification;\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003efacebook()\n    -\u003elinkedin()\n    -\u003eafter(function () {\n        // Send notification after user opens share modal\n        Notification::make()\n            -\u003etitle('Share options displayed')\n            -\u003ebody('The social sharing options have been presented to the user.')\n            -\u003esuccess()\n            -\u003esend();\n    }),\n```\n\nExample: Log Sharing Activity\n\n```php\nuse Illuminate\\Support\\Facades\\Log;\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003efacebook()\n    -\u003elinkedin()\n    -\u003ebefore(function () {\n        // Log that user initiated sharing\n        Log::info('User opened social share modal', [\n            'user_id' =\u003e auth()-\u003eid(),\n            'timestamp' =\u003e now(),\n            'url' =\u003e request()-\u003eurl()\n        ]);\n    })\n    -\u003eafter(function () {\n        // Log completion\n        Log::info('Social share modal displayed successfully');\n    })\n```\n\nExample: Custom Authorization Check\n\n```php\nuse Filament\\Notifications\\Notification;\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003efacebook()\n    -\u003elinkedin()\n    -\u003ebefore(function () {\n        // Check if user has permission to share\n        if (!auth()-\u003euser()-\u003ecan('share_content')) {\n            Notification::make()\n                -\u003etitle('Permission Denied')\n                -\u003ebody('You do not have permission to share content.')\n                -\u003edanger()\n                -\u003esend();\n            \n            throw new \\Exception('Unauthorized sharing attempt');\n        }\n    })\n```\n\nExample: Track Analytics\n\n```php\nuse Tapp\\FilamentSocialShare\\Actions\\SocialShareAction;\n\nSocialShareAction::make()\n    -\u003efacebook()\n    -\u003elinkedin()\n    -\u003ebefore(function () {\n        // Track sharing intent in analytics\n        event('social_share_initiated', [\n            'user_id' =\u003e auth()-\u003eid(),\n            'content_type' =\u003e 'article',\n            'content_id' =\u003e request()-\u003eroute('id')\n        ]);\n    })\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Tapp Network](https://github.com/TappNetwork)\n- [All Contributors](../../contributors)\n\nInspired by [PenguinUI](https://www.penguinui.com/ai-components/output-interactions).\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftappnetwork%2Ffilament-social-share","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftappnetwork%2Ffilament-social-share","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftappnetwork%2Ffilament-social-share/lists"}