jeroenherczeg/dog

A User Follow Package for Laravel 5
41 4
Install
composer require jeroenherczeg/dog
Latest Version:0.0.3
PHP:>=5.4
License:MIT
Last Updated:Aug 29, 2016
Links: GitHub  ·  Packagist
Maintainer: jeroenherczeg

A User Follow Package for Laravel 5

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

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.

Install

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;
    ...

Usage

// 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)

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email jeroen@herczeg.be instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Why Dog?

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?

Related Packages

jeroenherczeg/hyena

A Web Scraper for Laravel 5

15 7
jeroenherczeg/prairie-dog

A Stream Generator for Laravel 5

4 2
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

628,058,007 9,707