Download the PHP package multicaret/laravel-acquaintances without Composer

On this page you can find all versions of the php package multicaret/laravel-acquaintances. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-acquaintances

Laravel Acquaintances

Total Downloads Latest Version License

Laravel News Article

Supports Laravel 10 and below, with no dependencies

TL;DR

Gives eloquent models:

Take this example:

  1. Introduction
  2. Installation
  3. Friendships:
    • Friend Requests
    • Check Friend Requests
    • Retrieve Friend Requests
    • Retrieve Friends
    • Friend Groups
  4. Interactions
    • Traits Usage
    • Follow
    • Rate
    • Like
    • Favorite
    • Subscribe
    • Vote
    • View
    • Parameters
    • Query relations
    • Working with model
  5. Events
  6. Contributing

Introduction

This light package gives Eloquent models the ability to manage their acquaintances and other cool useful stuff. You can easily design your social-like System (Facebook, Twitter, Foursquare...etc).

Acquaintances includes:

Installation

First, install the package through Composer.

Laravel 5.8 and up => version 2.x (branch master)

Laravel 5.7 and below => version 1.x (branch v1)

Publish config and migrations:

Configure the published config in:

Finally, migrate the database to create the table:


Setup a Model

Example:

All available APIs are listed below for Friendships & Interactions.


Friendships:

Friend Requests:

Add Friendable Trait to User model.

Send a Friend Request

Accept a Friend Request

Deny a Friend Request

Remove Friend

Block a Model

Unblock a Model

Check if Model is Friend with another Model

Check Friend Requests:

Check if Model has a pending friend request from another Model

Check if Model has already sent a friend request to another Model

Check if Model has blocked another Model

Check if Model is blocked by another Model


Retrieve Friend Requests:

Get a single friendship

Get a list of all Friendships

Get a list of pending Friendships

Get a list of accepted Friendships

Get a list of denied Friendships

Get a list of blocked Friendships in total

Get a list of blocked Friendships by current user

Get a list of blocked Friendships by others

Get a list of pending Friend Requests

Get the number of Friends

Get the number of Pending Requests

Get the number of mutual Friends with another user

Retrieve Friends:

To get a collection of friend models (ex. User) use the following methods:

getFriends()

Parameters:

getFriendsOfFriends()

Parameters:

getMutualFriends()

Get mutual Friends with another user

Parameters:

Friend Groups:

The friend groups are defined in the config/acquaintances.php file. The package comes with a few default groups. To modify them, or add your own, you need to specify a slug and a key.

Since you've configured friend groups, you can group/ungroup friends using the following methods.

Group a Friend

Remove a Friend from family group

Remove a Friend from all groups

Get the number of Friends in specific group

To filter friendships by group you can pass a group slug.

Interactions

Traits Usage:

Add CanXXX Traits to User model.

Add CanBeXXX Trait to target model, such as 'Post' or 'Book' ...:

All available APIs are listed below.

Follow

\Multicaret\Acquaintances\Traits\CanFollow

\Multicaret\Acquaintances\Traits\CanBeFollowed

Rate

\Multicaret\Acquaintances\Traits\CanRate

\Multicaret\Acquaintances\Traits\CanBeRated

Like

\Multicaret\Acquaintances\Traits\CanLike

\Multicaret\Acquaintances\Traits\CanBeLiked

Favorite

\Multicaret\Acquaintances\Traits\CanFavorite

\Multicaret\Acquaintances\Traits\CanBeFavorited

Subscribe

\Multicaret\Acquaintances\Traits\CanSubscribe

Multicaret\Acquaintances\Traits\CanBeSubscribed

Vote

\Multicaret\Acquaintances\Traits\CanVote

\Multicaret\Acquaintances\Traits\CanBeVoted

View

\Multicaret\Acquaintances\Traits\CanView

\Multicaret\Acquaintances\Traits\CanBeViewed

Parameters

All the above mentioned methods of creating relationships, such as 'follow', 'like', 'unfollow', 'unlike', their syntax is as follows:

So you can call them like this:

Query relations

You may use the others in the same way.

Working with model

Events

This is the list of the events fired by default for each action:

Event name Fired
acq.friendships.sent When a friend request is sent
acq.friendships.accepted When a friend request is accepted
acq.friendships.denied When a friend request is denied
acq.friendships.blocked When a friend is blocked
acq.friendships.unblocked When a friend is unblocked
acq.friendships.cancelled When a friendship is cancelled
acq.ratings.rate When a an item or items get Rated
acq.ratings.unrate When a an item or items get unRated
acq.vote.up When a an item or items get upvoted
acq.vote.down When a an item or items get downvoted
acq.vote.cancel When a an item or items get vote cancellation
acq.likes.like When a an item or items get liked
acq.likes.unlike When a an item or items get unliked
acq.followships.follow When a an item or items get followed
acq.followships.unfollow When a an item or items get unfollowed
acq.favorites.favorite When a an item or items get favored
acq.favorites.unfavorite When a an item or items get unfavored
acq.subscriptions.subscribe When a an item or items get subscribed
acq.subscriptions.unsubscribe When a an item or items get unsubscribed
acq.views.view When a an item or items get viewed
acq.views.unview When a an item or items get unviewed

Contributing

See the CONTRIBUTING guide.

The initial version of this library was assisted by the following repos laravel-friendships & laravel-follow.

Change Log

See the log file.


All versions of laravel-acquaintances with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package multicaret/laravel-acquaintances contains the following files

Loading the files please wait ....