PHPackages                             banklansteve/social-interactions - 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. banklansteve/social-interactions

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

banklansteve/social-interactions
================================

This Laravel package provides an elegant and customizable solution for adding social interaction features to your application. It supports liking, favoriting, and following/unfollowing models, making it perfect for social media platforms, community forums, or any application requiring user engagement functionality. The package is designed to be easy to integrate, lightweight, and extendable, allowing developers to quickly implement interaction features without reinventing the wheel. With support for polymorphic relationships, this package can be applied to any model, including posts, comments, users, and more, ensuring maximum flexibility for your application's needs.

v1.0.0(1y ago)02MTPHPPHP &gt;=8.0

Since Jan 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/banklansteve/social-interactions)[ Packagist](https://packagist.org/packages/banklansteve/social-interactions)[ RSS](/packages/banklansteve-social-interactions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel Social Interactions Package
===================================

[](#laravel-social-interactions-package)

This Laravel package provides functionalities for liking, favoriting, and following/unfollowing users and content. It is designed to be used in social media-like applications where users can engage with posts, comments, and other users.

Features
--------

[](#features)

- **Likeable**: Allows users to like posts, comments, or other types of content.
- **Favoritable**: Allows users to favorite other users, posts, comments, or other content.
- **Followable**: Allows users to follow or unfollow other users.

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

[](#installation)

You can install this package via Composer.

```
composer require banklansteve/social-interactions`

```

Service Provider (Optional)
---------------------------

[](#service-provider-optional)

If you're using a version of Laravel earlier than 5.5 (which doesn't support package auto-discovery), you'll need to add the service provider manually to the config/app.php file.

```
'providers' => [
    // Other Service Providers

    BanklanSteve\SocialInteractions\SocialInteractionsServiceProvider::class,
],
```

Publish the Configuration (Optional)
------------------------------------

[](#publish-the-configuration-optional)

If you want to customize the default configuration, you can publish the package's config file:

```
php artisan vendor:publish --provider="BanklanSteve\SocialInteractions\SocialInteractionsServiceProvider"

```

### Usage Examples

[](#usage-examples)

This section should guide users on how to use your package. Since your package allows liking, favoriting, and following/unfollowing, add examples for each.

Usage
-----

[](#usage)

### Liking Content

[](#liking-content)

To use the `Likeable` functionality, add the `Likeable` trait to the model you want to make "likeable" (e.g., `Post`, `Comment`, etc.).

```
use BanklanSteve\SocialInteractions\Traits\Likeable;

class Post extends Model
{
    use Likeable;
}
```

### To like a post

[](#to-like-a-post)

```
$post = Post::find(1);
$post->like(auth()->id());  // Authenticated user likes the post

```

### To check if a user has liked a post

[](#to-check-if-a-user-has-liked-a-post)

```
if ($post->isLikedBy(auth()->id())) {
    echo "You liked this post!";
}

```

### To remove a like

[](#to-remove-a-like)

```
$post->unlike(auth()->id());  // Authenticated user unlikes the post

```

### Favouriting a content/user

[](#favouriting-a-contentuser)

To enable users to favorite content, add the Favoritable trait to the model you want to make "favoritable" (e.g., Post, Comment, etc.).

```
use BanklanSteve\SocialInteractions\Traits\Favoritable;

class Post extends Model
{
    use Favoritable;
}

```

### Then to favourite a post/content/user;

[](#then-to-favourite-a-postcontentuser)

```
$post = Post::find(1);
$post->favorite(auth()->id());  // Authenticated user favorites the post

```

### To check if a post/content is favourited by a user

[](#to-check-if-a-postcontent-is-favourited-by-a-user)

```
if ($post->isFavoritedBy(auth()->id())) {
    echo "You favorited this post!";
}

```

### To remove a favourite

[](#to-remove-a-favourite)

```
$post->unfavorite(auth()->id());  // Authenticated user unfavorites the post

```

Following Users
---------------

[](#following-users)

### To enable users to follow and unfollow other users, add the Followable trait to the User model.

[](#to-enable-users-to-follow-and-unfollow-other-users-add-the-followable-trait-to-the-user-model)

```
use BanklanSteve\SocialInteractions\Traits\Followable;

class User extends Model
{
    use Followable;
}

```

### To follow another user

[](#to-follow-another-user)

```
$userToFollow = User::find(2);
auth()->user()->follow($userToFollow);

```

### To unfollow a user

[](#to-unfollow-a-user)

```
auth()->user()->unfollow($userToUnFollow);

```

### To check if the authenticated user is following another user

[](#to-check-if-the-authenticated-user-is-following-another-user)

```
if (auth()->user()->isFollowing($anotherUser)) {
    echo "You are following this user!";
}

```

### Changelog

[](#changelog)

**v1.0.0** - Initial release with like, favorite, and follow/unfollow functionalities.

### Contributing

[](#contributing)

If you'd like to contribute to this package, feel free to fork the repository and submit a pull request. Please make sure your contributions follow the code style guidelines, and add tests for any new features or bug fixes.

### Support

[](#support)

For any issues or questions, please open an issue in the GitHub repository. Thank you.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance41

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

491d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d2acd31ba6ff45201795a10d1a28e26bdff533c4645663e0fcf742569f1e5d7?d=identicon)[banklan](/maintainers/banklan)

---

Top Contributors

[![banklansteve](https://avatars.githubusercontent.com/u/192537000?v=4)](https://github.com/banklansteve "banklansteve (8 commits)")

### Embed Badge

![Health badge](/badges/banklansteve-social-interactions/health.svg)

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

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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