PHPackages                             lifeids/groups - 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. lifeids/groups

ActiveLibrary

lifeids/groups
==============

Laravel 5 user groups package

111PHP

Since Nov 17Pushed 8y ago2 watchersCompare

[ Source](https://github.com/lifeids/groups)[ Packagist](https://packagist.org/packages/lifeids/groups)[ RSS](/packages/lifeids-groups/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Groups
------

[](#groups)

This package allows you to add user groups system to your Laravel 5 application

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

[](#installation)

From the command line, run:

```
composer require lifeids/groups

```

Add the service provider to your `config\app.php` the providers array

```
Lifeids\Groups\GroupsServiceProvider

```

You can use the facade for shorter code. Add this to your aliases:

```
'Groups' => Lifeids\Groups\Facades\GroupsFacade::class` to your `config\app.php

```

The class is bound to the ioC as Groups

```
$groups = App::make('Groups');

```

Publish the assets:

```
php artisan vendor:publish

```

This will publish database migrations.

#### Groups

[](#groups-1)

###### Create a group

[](#create-a-group)

```
$group = Groups::create($userId, $data);

```

Accepted fields in $data array

```
$data = [
        'name',
        'description', // optional
        'short_description', // optional
        'image',   // optional
        'private', // 0 or 1
        'extra_info', // optional
        'settings', // optional
        'conversation_id', // optional if you want to add messaging to your groups this can be useful
    ];

```

###### Delete a group

[](#delete-a-group)

```
$group->delete();

```

###### Update a group

[](#update-a-group)

```
$group->update($updateArray);

```

###### Get user instance with group relations

[](#get-user-instance-with-group-relations)

```
$user = Groups::getUser($userId);

```

###### Add members to group

[](#add-members-to-group)

```
$group->addMembers([$userId, $userId2, ...]);

```

###### Request to join a group

[](#request-to-join-a-group)

```
$group->request($userId);

```

###### Accept a group request

[](#accept-a-group-request)

```
$group->acceptRequest($userId);

```

###### Decline a group request

[](#decline-a-group-request)

```
$group->declineRequest($userId);

```

###### Group requests

[](#group-requests)

```
$requests = $group->requests;

```

###### How many groups a user is member of

[](#how-many-groups-a-user-is-member-of)

```
$user = Groups::getUser($userId);
$count = $user->groups->count();

```

###### Remove member(s) from group

[](#remove-members-from-group)

```
$group->leave([$userId, $userId2, ...]);

```

#### Posts

[](#posts)

###### Create a post

[](#create-a-post)

```
$post = Groups::createPost($data);

```

Acceptable values for Post $data array

```
$data = ['title', 'user_id', 'body', 'type', 'extra_info'];

```

###### Get post

[](#get-post)

```
$post = Groups::post($postId);

```

###### Update a post

[](#update-a-post)

```
$post->update($data);

```

###### Delete a post

[](#delete-a-post)

```
$post->delete();

```

###### Add a post to a group

[](#add-a-post-to-a-group)

```
$group->attachPost($postId);

```

###### Add multiple posts to a group

[](#add-multiple-posts-to-a-group)

```
$group->attachPost([$postId, $postId2, ...]);

```

###### Remove post from a group

[](#remove-post-from-a-group)

```
$group->detachPost($postId);

```

###### Group posts

[](#group-posts)

```
$posts = $group->posts;

$posts = $group->posts()->paginate(5);

$posts = $group->posts()->orderBy('id', 'DESC')->paginate(5);

```

###### User posts

[](#user-posts)

```
$user = Groups::getUser($userId);

$posts = $user->posts;

```

#### Comments

[](#comments)

Acceptable values for Comment $data array

```
$data = ['post_id', 'user_id', 'body'];

```

###### Add comment

[](#add-comment)

```
$comment = Groups::addComment($data);

```

###### Get comment

[](#get-comment)

```
$comment = Groups::comment($commentId);

```

###### Update a comment

[](#update-a-comment)

```
$comment->update($data);

```

###### Delete a comment

[](#delete-a-comment)

```
$comment->delete();

```

#### Reporting

[](#reporting)

###### Abuse Report a comment or post

[](#abuse-report-a-comment-or-post)

```
$comment->abuseReport($userIdOfReporter);
$post->abuseReport($userIdOfReporter);

```

###### Remove a post or comment abuse report

[](#remove-a-post-or-comment-abuse-report)

```
$post->removeAbuseReport($userId);
$comment->removeAbuseReport($userId);

```

###### Toggle abuse report/unreport a post or comment

[](#toggle-abuse-reportunreport-a-post-or-comment)

```
$post->toggleAbuseReport($userId);
$comment->toggleAbuseReport($userId);

```

###### Post or Comment Report count

[](#post-or-comment-report-count)

```
$commentReports = $comment->reportsCount;
$postReports = $post->reportsCount;

```

#### Likes

[](#likes)

###### Like a post or comment

[](#like-a-post-or-comment)

```
$post->like($userId);
$comment->like($userId);

```

###### Unlike a post or comment

[](#unlike-a-post-or-comment)

```
$post->unlike($userId);
$comment->unlike($userId);

```

###### Toggle like/unlike a post or comment

[](#toggle-likeunlike-a-post-or-comment)

```
$post->toggleLike($userId);
$comment->toggleLike($userId);

```

###### Post or Comment likes count

[](#post-or-comment-likes-count)

```
$postLikes = $post->likesCount;
$commentLikes = $comment->likesCount;

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f8ddf259c251d123025062a770f9d651380366e7a20b6621047567f42bff2a67?d=identicon)[lifeids](/maintainers/lifeids)

---

Top Contributors

[![lifeids](https://avatars.githubusercontent.com/u/15844994?v=4)](https://github.com/lifeids "lifeids (23 commits)")

### Embed Badge

![Health badge](/badges/lifeids-groups/health.svg)

```
[![Health](https://phpackages.com/badges/lifeids-groups/health.svg)](https://phpackages.com/packages/lifeids-groups)
```

PHPackages © 2026

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