dev-master
9999999-dev https://github.com/hkan/follow
The Requires
- php >=5.4.0
- illuminate/support 4.2.*
by Hakan Aktas
laravel user follow
Wallogit.com
2017 © Pedro Peláez
User follow system for Laravel 4., (*1)
Add the following line to your composer.json's require array., (*2)
"hkan/follow": "dev-master"
Migrate to database, (*3)
php artisan migrate --package="hkan/follow"
Copy the following line to the providers array of app/config/app.php, (*4)
'Hkan\Follow\FollowServiceProvider'
Add the trait to your User model., (*5)
use \Hkan\Follow\Traits\FollowTrait;
$user->follow($prettyGirl) $user->unfollow($belieberGirl)
$user->isFollowing($someDude) $user->isFollowedBy($creepyDude)
$user->followers() $user->followings() $user->follower_count // Shortcut for $user->followers()->count() $user->following_count // Shortcut for $user->followings()->count()
User::mostFollowed()->first() // Most followed user User::mostFollowed()->take(10)->get() // Most followed 10 users
laravel user follow