PHPackages                             mohamedshuaau/laravel-sharer - 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. mohamedshuaau/laravel-sharer

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

mohamedshuaau/laravel-sharer
============================

A package for Laravel which allows users to generate and share links on Social Medias

08PHP

Since Jan 31Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mohamedshuaau/laravel-sharer)[ Packagist](https://packagist.org/packages/mohamedshuaau/laravel-sharer)[ RSS](/packages/mohamedshuaau-laravel-sharer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Sharer
--------------

[](#laravel-sharer)

This package can be used to create shareable links to Social Media.

#### Requirements:

[](#requirements)

This package requires Laravel version &gt;= 6.0 and php version &gt;=7.2.

VersionLaravel Version^1.0^6.0
#### Installation:

[](#installation)

Use composer to install the package

```
composer require mohamedshuaau/laravel-sharer

```

Laravel's auto discovery should register the package service provider.

After the installation, you can publish the package content with:

```
php artisan vendor:publish --provider="Shuaau\LaravelSharer\LaravelSharerServiceProvider" --tag="config"

```

The publish command will publish the configuration file to config folder.

#### Basic Usage:

[](#basic-usage)

In your Blade file, you can use the `sharer` helper function to create a shareable link.

```
{{ sharer('facebook', 'https://google.com', []) }}
//expected output: https://www.facebook.com/sharer/sharer.php?u=https://google.com
```

If you want to render a button instead of the link, you can simply pass in a 4th parameter for a button like so:

```
{!! sharer('facebook', 'https://google.com', [], true) !!}
//expected output is a facebook icon
//{!! !!} is used instead of {{ }}. This is to render the button
```

You will be required to link fontawesome for buttons to work as the buttons icons uses fontawesome.

Sharing a Post (example):

```
//rending a button
{!! sharer('facebook', route('posts.show', $post->slug), [], true) !!}
```

```

```

Some of the Socials expects extra parameters. In that case, you could simply pass them as 'options' for the third parameter like so:

```
{{ sharer('linkedin', 'https://google.com', ['title' => 'my awesome title'], true) }}
//expected output is a facebook icon
```

The value of the config options will always be ignored. They are used to validate the passed options. If you want to ignore an option, exclude them from the options array.

#### Config:

[](#config)

In the config file `sharer.php`, you will find an array of social links along with their options and button options. You are free to follow the pattern and add as many as you want. This package is not limited to only shareable "links" such as Facebook, Twitter etc, but it can also be used on Whatsapp, Viber, Telegram.

If you are going to be using the button, please pass the `button_color` and `button_icon`to the `button_options` array. The `options` array for each social will defer. Which ever option you want to include in the URL should be added to the config. However, the values will not be taken from the configuration. Instead, you will be explicitly passing the options and its value. The `options` in the config file will validate that sets itself as 'required' once you mention them in the configuration file.

More features are to come in the future. This package is open for suggestions and improvements.
You are free to use this package and modify it to your needs.

Happy Coding 😉

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

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

---

Top Contributors

[![armageddan](https://avatars.githubusercontent.com/u/31499401?v=4)](https://github.com/armageddan "armageddan (3 commits)")

### Embed Badge

![Health badge](/badges/mohamedshuaau-laravel-sharer/health.svg)

```
[![Health](https://phpackages.com/badges/mohamedshuaau-laravel-sharer/health.svg)](https://phpackages.com/packages/mohamedshuaau-laravel-sharer)
```

###  Alternatives

[byjg/singleton-pattern

A lightweight PHP implementation of the Design Pattern Singleton using trait.

1055.4k2](/packages/byjg-singleton-pattern)[kriss/webman-eloquent-ide-helper

webman-eloquent-ide-helper plugin

142.7k](/packages/kriss-webman-eloquent-ide-helper)

PHPackages © 2026

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