Download the PHP package skybluesofa/laravel-followers without Composer
On this page you can find all versions of the php package skybluesofa/laravel-followers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download skybluesofa/laravel-followers
More information about skybluesofa/laravel-followers
Files in skybluesofa/laravel-followers
Package laravel-followers
Short Description This package gives Eloquent models the ability to manage their followers.
License MIT
Informations about the package laravel-followers
Laravel 5 Followers
Gives Eloquent models the ability to manage their followers.
Models can:
- Send Follow Requests
- Accept Follow Requests
- Deny Follow Requests
- Block Another Model
Installation
First, install the package through Composer.
Then include the service provider inside config/app.php
.
Publish config and migrations
Configure the published config in
Finally, migrate the database
Setup a Model
How to use
Check the Test file to see the package in action
Methods
Send a Follow Request
Will trigger a Skybluesofa\LaravelFollowers\Events\FollowRequest
event.
Accept a Follow Request
Will trigger a Skybluesofa\LaravelFollowers\Events\FollowRequestAccepted
event.
Deny a Follow Request
Will trigger a Skybluesofa\LaravelFollowers\Events\FollowRequestDenied
event.
Remove Follow
Will trigger a Skybluesofa\LaravelFollowers\Events\Unfollow
event.
Block a User
Will trigger a Skybluesofa\LaravelFollowers\Events\FollowingBlocked
event.
Unblock a User
Will trigger a Skybluesofa\LaravelFollowers\Events\FollowingUnblocked
event.
Check if User is Following another User
Check if User is being Followed by another User
Check if User has a pending Follow request from another User
Check if User sent a pending Follow request to another User
Check if User has blocked another User
Check if User is blocked by another User
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
Get a list of pending Friend Requests
Get the number of Friends
Friends
To get a collection of friend models (ex. User) use the following methods:
Get Friends
Get Friends Paginated
Events
These events are triggered during the lifecycle of following/unfollowing/accept/deny followers:
To listen for and react to these events, follow the instructions available in the Laravel Documentation.
Thank you
The basis of this code was garnered from https://github.com/hootlex/laravel-friendships. Although it was a jumping off point, much of the code has been rewritten to allow for Following as opposed to Mutual Friendship.
Contributing
See the CONTRIBUTING guide.