All Projects → musonza → Groups

musonza / Groups

Licence: mit
A Laravel 5 user groups package

Projects that are alternatives of or similar to Groups

Doesangue Core
Online platform that connects people interested in blood donation
Stars: ✭ 91 (+37.88%)
Mutual labels:  laravel, social-network
Laravel Social Network
Laravel 5.4 - location-based social network
Stars: ✭ 114 (+72.73%)
Mutual labels:  laravel, social-network
Voten
The code that powers voten.co
Stars: ✭ 1,215 (+1740.91%)
Mutual labels:  laravel, social-network
Bee-Connect
Ruby on Rails App. A good example of how to build social networking system with live chat support, blogging,groups etc.
Stars: ✭ 30 (-54.55%)
Mutual labels:  groups, social-network
Pixelfed
Photo Sharing. For Everyone.
Stars: ✭ 3,237 (+4804.55%)
Mutual labels:  laravel, social-network
Opensource Socialnetwork
Open Source Social Network (OSSN) is a social networking software written in PHP. It allows you to make a social networking website and helps your members build social relationships, with people who share similar professional or personal interests. It is available in 16 international languages.
Stars: ✭ 710 (+975.76%)
Mutual labels:  groups, social-network
Socialnetwork
Laravel and Vue.JS powerd social network
Stars: ✭ 101 (+53.03%)
Mutual labels:  laravel, social-network
linkcast
Share links, images, blogs and everything on the web with your friends in one click using this chrome extension Linkcast
Stars: ✭ 13 (-80.3%)
Mutual labels:  groups, social-network
clubi
A group-oriented social media platform written in Laravel and Vue
Stars: ✭ 29 (-56.06%)
Mutual labels:  groups, social-network
Laravel Social Auto Posting
🌈Laravel social auto posting
Stars: ✭ 306 (+363.64%)
Mutual labels:  laravel, social-network
Laravel Love
Add Social Reactions to Laravel Eloquent Models. It lets people express how they feel about the content. Fully customizable Weighted Reaction System & Reaction Type System with Like, Dislike and any other custom emotion types. Do you react?
Stars: ✭ 822 (+1145.45%)
Mutual labels:  laravel, social-network
Alumni Network
The official home of the freeCodeCamp Alumni Network ⭐️ ⭐️ ⭐️
Stars: ✭ 65 (-1.52%)
Mutual labels:  social-network
Facemash
A React app to vote 👍👎!!
Stars: ✭ 64 (-3.03%)
Mutual labels:  social-network
Laravel Mongodb Passport
A package to get Laravel Passport working with MongoDB
Stars: ✭ 64 (-3.03%)
Mutual labels:  laravel
Iwatched
Track movies or tv shows you watched.
Stars: ✭ 64 (-3.03%)
Mutual labels:  laravel
Laravel Leaflet Example
Laravel Leaflet JS project example.
Stars: ✭ 66 (+0%)
Mutual labels:  laravel
Watchable
Enable users to watch various models in your application.
Stars: ✭ 65 (-1.52%)
Mutual labels:  laravel
Laravel Potion
laravel - Potion is a pure PHP asset manager for Laravel 5 based off of Assetic.
Stars: ✭ 63 (-4.55%)
Mutual labels:  laravel
Laravel Email Verification
Laravel package to handle user verification using an activation mail
Stars: ✭ 63 (-4.55%)
Mutual labels:  laravel
Laravel Auth Tests
Some boilerplate tests for Laravel's auth scaffold
Stars: ✭ 62 (-6.06%)
Mutual labels:  laravel

Build Status Downloads Packagist StyleCI

Table of content

  • Description
  • Installation
    • Install with Composer
    • Add service provider to App
    • Add facade alias to App
    • Publish vendor with Artisan
    • Tables details
    • Make migration with Artisan
  • Usage
    • Groups
      • Create, Delete, Update, Users list, Add member, Join request, Accept join, Decline join, Join request list
    • Posts
      • Create, Get, Update, Delete, Add to group, Group posts list, User posts list
    • Comments
      • Add, Get, Update, Delete
    • Reporting
      • Report, Remove, Toggle , Count
    • Likes
      • Like, Unlike, Toggle, Count

Description

This package allows you to add user groups (groups, comment, like ...) system to your Laravel 5 application.

Installation

  1. Via Composer, from the command line, run :
composer require musonza/groups
  1. Add the service provider to ./config/app.php in providers array, like :
    /*
     * Package Service Providers...
     */
    Musonza\Groups\GroupsServiceProvider::class,
  1. You can use the facade for shorter code. Add this to ./config/app.php at the end of aliases array :
    'Groups' => Musonza\Groups\Facades\GroupsFacade::class,

Note : The class is bound to the ioC as Groups.

$groups = App::make('Groups');
  1. From the command line, publish the assets:
php artisan vendor:publish

Note : This will publish database migrations in ./database/migrations/.

create_groups_table // main groups table
    id
    name
    description
    short_description
    image
    url
    user_id
    private
    conversation_id
    extra_info
    settings

# Usage

## Groups 

1. ##### Create a group

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

Note : Accepted fields in $data array :

$data = [
  'name'              => '',
  'description'       => '', // optional
  'short_description' => '', // optional
  'image'             => '', // optional
  'private'           => 0,  // 0 (public) or 1 (private)
  'extra_info'        => '', // optional
  'settings'          => '', // optional
  'conversation_id'   => 0,  // optional if you want to add messaging to your groups this can be useful
];
  1. Delete a group
$group->delete();
  1. Update a group
$group->update($updateArray);
  1. Get user instance with group relations
$user = Groups::getUser($userId); 
  1. Add members to group
$group->addMembers([$userId, $userId2, ...]);
  1. Request to join a group
$group->request($userId);
  1. Accept a group request
$group->acceptRequest($userId);
  1. Decline a group request
$group->declineRequest($userId);
  1. Group requests
$requests = $group->requests;
  1. How many groups a user is member of
$user = Groups::getUser($userId); 
$count = $user->groups->count();
  1. Remove member(s) from group
$group->leave([$userId, $userId2, ...]);

Posts

  1. Create a post
$post = Groups::createPost($data);

Note : Acceptable values for Post $data array

$data = [
  'title'      => '', 
  'user_id'    => 0, 
  'body'       => '', 
  'type'       => '', 
  'extra_info' => '',
];
  1. Get post
$post = Groups::post($postId);
  1. Update a post
$post->update($data);
  1. Delete a post
$post->delete();
  1. Add a post to a group
$group->attachPost($postId);
  1. Add multiple posts to a group
$group->attachPost([$postId, $postId2, ...]);
  1. Remove post from a group
$group->detachPost($postId);
  1. Group posts
$posts = $group->posts;

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

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

  1. User posts
$user = Groups::getUser($userId);

$posts = $user->posts;

Comments

Note : Acceptable values for Comment $data array

$data = [
  'post_id' => 0,  
  'user_id' => 0, 
  'body'    => '',
];
  1. Add comment
$comment = Groups::addComment($data);
  1. Get comment
$comment = Groups::comment($commentId);
  1. Update a comment
$comment->update($data);
  1. Delete a comment
$comment->delete();

Reporting

  1. Report a comment or post
$comment->report($userIdOfReporter);
$post->report($userIdOfReporter);
  1. Remove a post or comment report
$post->removeReport($userId);
$comment->removeReport($userId);
  1. Toggle report/unreport a post or comment
$post->toggleReport($userId);
$comment->toggleReport($userId);
  1. Post or Comment Report count
$commentReports = $comment->reportsCount;
$postReports = $post->reportsCount;

Likes

  1. Like a post or comment
$post->like($userId);
$comment->like($userId);
  1. Unlike a post or comment
$post->unlike($userId);
$comment->unlike($userId);
  1. Toggle like/unlike a post or comment
$post->toggleLike($userId);
$comment->toggleLike($userId);
  1. Post or Comment likes count
$postLikes = $post->likesCount;
$commentLikes = $comment->likesCount;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].