https://github.com/enflow/laravel-social-share
https://github.com/enflow/laravel-social-share
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/enflow/laravel-social-share
- Owner: enflow
- License: mit
- Created: 2021-01-07T11:05:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-22T19:59:18.000Z (8 months ago)
- Last Synced: 2025-07-02T20:22:14.048Z (4 months ago)
- Language: PHP
- Size: 50.8 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Easily add social share links
[](https://packagist.org/packages/enflow/laravel-social-share)

[](https://packagist.org/packages/enflow/laravel-social-share)
The `enflow/laravel-social-share` package provides an easy way to add social share links to your templates:

The main advantage of implementing it this way instead of using a service like AddThis, is this doesn't use any JavaScript and does not have any privacy concerns.
## Installation
You can install the package via composer:
``` bash
composer require enflow/laravel-social-share
```
The package will auto-register. You may add the `SocialShareFacade` to your `app.aliases` array:
```php
'SocialShare' => \Enflow\SocialShare\SocialShareFacade::class,
```
### CSS
This package includes a CSS file for deafult styling. You can copy this file to your own CSS structure and modify it, or import it in your app.css / app.scss file to use the default variant.
The advantage of including it is that it will be automatically updated if changes are made in upcoming versions.
```css
@import "../../vendor/enflow/laravel-social-share/dist/css/social-share.css";
```
## Usage
You can use the Facade in your templates as follows:
```blade
{{ SocialShare::facebook()->x()->linkedin()->whatsapp()->render() }}
```
You can chain multiple services next to each other. The following services are currently supported. Pull requests are welcome to expand this.
- Facebook
- X _(previously Twitter)_
- LinkedIn
- WhatsApp
- Pinterest
- Reddit
- Telegram
- Email
- Twitter _(deprecated)_ - automatically replaced with `x`
You can increase the size or set styling options as follows:
```
{{ SocialShare::facebook()->square()->render() }} // Style: square
{{ SocialShare::facebook()->rounded()->render() }} // Style: rounded (default)
{{ SocialShare::facebook()->circle()->render() }} // Style: circle
{{ SocialShare::facebook()->normal()->render() }} // Normal size (default)
{{ SocialShare::facebook()->large()->render() }} // Large size
```
You may want to pass along text to the different sharing options. This text will be appended to the current URL:
```blade
{{ SocialShare::facebook()->text($page->title)->render() }}
```
You can combine all options:
```blade
{{ SocialShare::facebook()->x()->reddit()->square()->large()->text('Lorem ipsum!')->render() }}
```
## Config
You can publish the config to tweak the services and their colors.
Pushing the config file:
``` bash
php artisan vendor:publish --provider="Enflow\SocialShare\SocialShareServiceProvider" --tag="config"
```
## Testing
``` bash
$ composer test
```
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security
If you discover any security related issues, please email michel@enflow.nl instead of using the issue tracker.
## Credits
- [Michel Bardelmeijer](https://github.com/mbardelmeijer)
- [All Contributors](../../contributors)
## About Enflow
Enflow is a digital creative agency based in Alphen aan den Rijn, Netherlands. We specialize in developing web applications, mobile applications and websites. You can find more info [on our website](https://enflow.nl/en).
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.