PHPackages                             aerni/social-links - 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. aerni/social-links

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

aerni/social-links
==================

Easily generate Social Sharing Links

v4.1.1(1mo ago)634.9k↓33.7%6MITPHPPHP ^8.3CI passing

Since Jul 29Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/aerni/statamic-social-links)[ Packagist](https://packagist.org/packages/aerni/social-links)[ Docs](https://github.com/aerni/statamic-social-links)[ RSS](/packages/aerni-social-links/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (18)Used By (0)

SocialLinks [![Statamic](https://camo.githubusercontent.com/52f227167b36d6b4e51b2716643af8c149223e9fe8bdf50bbf442653d0d1f87f/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f53746174616d69632f362e302b2f464632363945)](https://camo.githubusercontent.com/52f227167b36d6b4e51b2716643af8c149223e9fe8bdf50bbf442653d0d1f87f/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f53746174616d69632f362e302b2f464632363945)
=============================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#sociallinks-)

This addon provides an easy way to create social profile and sharing links for channels like Facebook, Twitter and more.

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

[](#installation)

Install the addon using Composer.

```
composer require aerni/social-links
```

---

Supported Channels
------------------

[](#supported-channels)

This addon supports the following social channels: `Facebook`, `GitHub`, `Instagram`, `LinkedIn`, `Mail`, `Pinterest`, `Telegram`, `Twitter`, `Vimeo`, `WhatsApp`, `Xing`, `YouTube`

---

Profile Link
------------

[](#profile-link)

Create a link to a social profile by providing the social `channel` and `handle` of the profile:

```
{{ social:profile channel="facebook" handle="michaelaerni" }}
```

Or using the shorthand:

```
{{ social:facebook:profile handle="michaelaerni" }}
```

---

Sharing Link
------------

[](#sharing-link)

Create a sharing link by providing the social `channel`:

```
{{ social:share channel="facebook" }}
```

Or using the shorthand:

```
{{ social:facebook:share }}
```

### Parameters

[](#parameters)

There are a number of parameters you may use to customize the sharing links:

#### Facebook

[](#facebook)

NameDescriptionUsage`url`The URL of the page to shareOptional`text`The text of your postOptional#### LinkedIn

[](#linkedin)

NameDescriptionUsage`url`The URL of the page to shareOptional`title`The title of your postOptional`text`The text of your postOptional`source`The source of your postOptional#### Mail

[](#mail)

NameDescriptionUsage`url`The URL of the page to shareOptional`to`The email address you want to send the email toOptional`cc`The email address to CCOptional`bcc`The email address to BCCOptional`subject`The subject of the emailOptional`body`The body of the emailOptionalThe `url` will be placed in the body of the email by default. You can customize the email body text by using the `body` parameter. Note, that this will override the default body text that includes the `url`. You will have to manually add the `url` in the `body` parameter like so:

```
{{ social:mail:share body="I want to share this great site with you: {permalink}" }}
```

#### Pinterest

[](#pinterest)

NameDescriptionUsage`url`The URL of the page to shareOptional`image`The image to shareOptional#### Telegram

[](#telegram)

NameDescriptionUsage`url`The URL of the page to shareOptional`text`The description of your shared pageOptional#### Twitter

[](#twitter)

NameDescriptionUsage`url`The URL of the page to shareOptional`text`The text of your TweetOptional`handle`The twitter handle you want to add to the TweetOptional#### WhatsApp

[](#whatsapp)

NameDescriptionUsage`url`The URL of the page to shareOptional#### Xing

[](#xing)

NameDescriptionUsage`url`The URL of the page to shareOptional---

Channel Name
------------

[](#channel-name)

Get the name of a social channel:

```
{{ social:name channel="facebook" }}
```

Or using the shorthand:

```
{{ social:facebook:name }}
```

---

Tag Pair
--------

[](#tag-pair)

You may also use a tag pair to get all the data at once:

```
{{ social channel="facebook" handle="michaelaerni" }}
  {{ profile }}
  {{ share }}
  {{ name }}
{{ /social }}
```

Or using the shorthand:

```
{{ social:facebook handle="michaelaerni" }}
  {{ profile }}
  {{ share }}
  {{ name }}
{{ /social:facebook }}`
```

---

Extending
---------

[](#extending)

You can register your own custom channels in two ways.

### Creating a Custom Channel

[](#creating-a-custom-channel)

Create a class that extends `BaseChannel`. A channel can support profile links, share links, or both. All params passed to the Antlers tag are available in the channel via `$this->params->get('param_name')`.

#### Profile Channels

[](#profile-channels)

To support profile links, set the `$profileBaseUrl` property. The profile URL is built by appending the `handle` param to the base URL. The `handle` param must be provided on the Antlers tag.

Property/MethodDescription`$profileBaseUrl`The base URL for profile links.```
use Aerni\SocialLinks\Channels\BaseChannel;

class Mastodon extends BaseChannel
{
    protected string $profileBaseUrl = 'https://mastodon.social';
}
```

#### Share Channels

[](#share-channels)

To support share links, set the `$shareBaseUrl` property and override `shareUrlParams()` to define the query parameters for the share URL. The `url` param defaults to the current page URL if not explicitly provided on the Antlers tag.

Property/MethodDescription`$shareBaseUrl`The base URL for share links.`shareUrlParams()`Override this method to define the query parameters for the share URL. Must return an array.`$encodeShareUrlQuery`Whether to URL-encode the share URL query string. Defaults to `true`. Set to `false` for channels like Mail that need raw URLs.```
use Aerni\SocialLinks\Channels\BaseChannel;

class Reddit extends BaseChannel
{
    protected string $shareBaseUrl = 'https://www.reddit.com/submit';

    protected function shareUrlParams(): array
    {
        return [
            'url' => $this->params->get('url'),
            'title' => $this->params->get('title'),
        ];
    }
}
```

If you need dynamic logic for the base URL, override the `profileBaseUrl()` or `shareBaseUrl()` method instead of using the property.

### Registering via Config

[](#registering-via-config)

Publish the config file and add your channel class to the `channels` array in `config/social-links.php`:

```
return [
    'channels' => [
        App\Channels\Mastodon::class,
    ],
];
```

### Registering Programmatically

[](#registering-programmatically)

Register a channel from a service provider's `boot()` method:

```
use App\Channels\Mastodon;

public function boot(): void
{
    Mastodon::register();
}
```

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance89

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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 ~137 days

Recently: every ~172 days

Total

16

Last Release

53d ago

Major Versions

v2.3.1 → v3.0.02023-01-05

v3.3.0 → v4.0.02026-03-25

PHP version history (4 changes)v2.0.0PHP ^7.2.5

v2.2.0PHP ^7.4|^8.0

v3.0.0PHP ^8.0

v4.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f0a168dc347e5e141dc13cec734d3b0a25a13445069483732580f26f71456a6?d=identicon)[aerni](/maintainers/aerni)

---

Top Contributors

[![aerni](https://avatars.githubusercontent.com/u/23167701?v=4)](https://github.com/aerni "aerni (30 commits)")[![el-schneider](https://avatars.githubusercontent.com/u/26460248?v=4)](https://github.com/el-schneider "el-schneider (1 commits)")[![imacrayon](https://avatars.githubusercontent.com/u/3410149?v=4)](https://github.com/imacrayon "imacrayon (1 commits)")[![jelleroorda](https://avatars.githubusercontent.com/u/9193686?v=4)](https://github.com/jelleroorda "jelleroorda (1 commits)")[![RafaelKr](https://avatars.githubusercontent.com/u/14234815?v=4)](https://github.com/RafaelKr "RafaelKr (1 commits)")[![ryanmitchell](https://avatars.githubusercontent.com/u/51899?v=4)](https://github.com/ryanmitchell "ryanmitchell (1 commits)")

---

Tags

statamicstatamic-addonsocial mediastatamicsocial sharing links

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/aerni-social-links/health.svg)

```
[![Health](https://phpackages.com/badges/aerni-social-links/health.svg)](https://phpackages.com/packages/aerni-social-links)
```

###  Alternatives

[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

2381.5k10](/packages/marcorieser-statamic-livewire)[aerni/livewire-forms

A Statamic forms framework powered by Laravel Livewire

2912.8k](/packages/aerni-livewire-forms)[visuellverstehen/statamic-classify

A useful helper to add CSS classes to all HTML tags generated by the bard editor.

20116.8k](/packages/visuellverstehen-statamic-classify)[mitydigital/feedamic

A fully-featured RSS and Atom feed generator for Statamic.

1064.0k](/packages/mitydigital-feedamic)[withcandour/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

13128.3k](/packages/withcandour-aardvark-seo)[swiftmade/statamic-clear-assets

Deletes unused assets. Saves storage space.

1938.6k](/packages/swiftmade-statamic-clear-assets)

PHPackages © 2026

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