Package Data | |
---|---|
Maintainer Username: | jeroenherczeg |
Maintainer Contact: | jeroen@herczeg.be (Jeroen Herczeg) |
Package Create Date: | 2016-08-13 |
Package Last Update: | 2016-08-29 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-12 15:15:42 |
Package Statistics | |
---|---|
Total Downloads: | 38 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Add a user following system like Twitter, Quora or any other social network that allows you to follow another user and have users follow you.
You can install the package via composer:
$ composer require jeroenherczeg/dog
Next, you must install the service provider:
// config/app.php
'providers' => [
...
Jeroenherczeg\Dog\FollowServiceProvider::class,
];
You can publish the migration with:
php artisan vendor:publish --provider="Jeroenherczeg\Dog\FollowServiceProvider"
After the migration has been published you can create the followers
table by running the migrations:
php artisan migrate
Add the followable trait to the User model
use Jeroenherczeg\Dog\Followable;
class User extends Model
{
use Followable;
...
// Follow User
$user->follow(1)
$user->follow([1,2,3,4])
// Unfollow User
$user->unfollow(1)
$user->unfollow([1,2,3,4])
// Get Followers
$user->followers()
// Get Followings
$user->followings()
// Check if Follow
$user->isFollowing(1)
// Check if Followed By
$user->isFollowedBy(1)
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email jeroen@herczeg.be instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
Your dog follows you because it's highly social - has a powerful emotional need for companionship - and knows that you are super-cool. You are the source of all good things in its life: food, walks, rides, treats, toys. Who knows what amazing thing will happen wherever you're going?