2017 © Pedro Peláez
 

library friendship

friendship system for Laravel 5

image

ghanem/friendship

friendship system for Laravel 5

  • Wednesday, November 25, 2015
  • by ghanem
  • Repository
  • 1 Watchers
  • 17 Stars
  • 88 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 2 Versions
  • 6 % Grown

The README.md

Laravel Friendship

This package will allow you to add a full report system into your Laravel application., (*1)

Installation

First, pull in the package through Composer., (*2)

composer require ghanem/friendship

And then include the service provider within app/config/app.php., (*3)

'providers' => [
    Ghanem\Friendship\FriendshipServiceProvider::class
];

At last you need to publish, (*4)

php artisan vendor:publish --provider="Ghanem\Friendship\FriendshipServiceProvider" 

and run the migration., (*5)

php artisan migrate

Setup a Model

<?php

namespace App;

use Ghanem\Friendship\Contracts\Friendable;
use Ghanem\Friendship\Traits\Friendable as FriendableTrait;
use Illuminate\Database\Eloquent\Model;

class User extends Model implements Friendable
{
    use FriendableTrait;
}

Examples

Send a Friend-Request to a Model

$user->befriend($userToBeFriendsWith);

Unfriend a Model

$user->unfriend($userToBeFriendsWith);

Deny a Friend-Request from a Model

$user->denyFriendRequest($userToBeFriendsWith);

Accept a Friend-Request from a Model

$user->acceptFriendRequest($userToBeFriendsWith);

Block a Model

$user->blockFriendRequest($userToBeFriendsWith);

Unblock a Model

$user->unblockFriendRequest($userToBeFriendsWith);

Check if the Model has blocked another Model

$user->hasBlocked($userToBeFriendsWith);

Check if one Model is blocked by another Model

$user->isBlockedBy($userToBeFriendsWith);

Check if a Friendship exists between two models

$user->isFriendsWith($userToBeFriendsWith);

Get a single friendship

$user->getFriendship($userToBeFriendsWith);

Get a list of all Friendships

$user->getAllFriendships();

Get a list of pending Friendships

$user->getPendingFriendships();

Get a list of accepted Friendships

$user->getAcceptedFriendships();

Get a list of denied Friendships

$user->getDeniedFriendships();

Get a list of blocked Friendships

$user->getBlockedFriendships();

Get a list of pending Friend-Requests

$user->getFriendRequests();

The Versions

25/11 2015

dev-master

9999999-dev

friendship system for Laravel 5

  Sources   Download

MIT

The Requires

 

by abdullah ghanem

laravel friends friendship friend system

23/10 2015

1.0

1.0.0.0

friendship system for Laravel 5

  Sources   Download

MIT

The Requires

 

by abdullah ghanem

laravel friends friendship friend system