PHPackages                             fenos/rally - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fenos/rally

ActiveLibrary

fenos/rally
===========

Followers system for laravel 4

1.0.11(11y ago)372278[3 issues](https://github.com/fenos/Rally/issues)[1 PRs](https://github.com/fenos/Rally/pulls)MITPHPPHP &gt;=5.4.0

Since May 14Pushed 9y ago3 watchersCompare

[ Source](https://github.com/fenos/Rally)[ Packagist](https://packagist.org/packages/fenos/rally)[ RSS](/packages/fenos-rally/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (8)Dependencies (3)Versions (11)Used By (0)

Rally (Deprecated)
==================

[](#rally-deprecated)

[![Build Status](https://camo.githubusercontent.com/49df9693a96827f9577dbba8e69894e7c853a1325a188aa62e96e9b1dbc7238c/68747470733a2f2f7472617669732d63692e6f72672f66656e6f732f52616c6c792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fenos/Rally)[![ProjectStatus](https://camo.githubusercontent.com/507c9e89508fd3d198980b2890fb3af336c04074225898cbffaa9a18f6ed1ed0/687474703a2f2f7374696c6c6d61696e7461696e65642e636f6d2f66656e6f732f52616c6c792e706e67)](http://stillmaintained.com/fenos/Rally)[![Latest Stable Version](https://camo.githubusercontent.com/e794e51c14e780c5391d4635b164f1ae719631873d247bb7371aeb8398120c89/68747470733a2f2f706f7365722e707567782e6f72672f66656e6f732f72616c6c792f762f737461626c652e706e67)](https://packagist.org/packages/fenos/rally)[![License](https://camo.githubusercontent.com/f7d7e21836cc2cb48721ffb26c8267d87f8f863d8ab4c51ac10f6afa69028b01/68747470733a2f2f706f7365722e707567782e6f72672f66656e6f732f72616c6c792f6c6963656e73652e706e67)](https://packagist.org/packages/fenos/rally)

Follow, Let Follow you, Follow with Rally. Rally is a plugin that implement in your application the follow system. It is quick to implement on your laravel project. It give you the freedom to create your own followers system. It is can be polymorphic, so you can follow anybody or anything you want. The package has been released for laravel 4.\*

- [Installation](#installation)
- [Documentation](#documentation)
    - [Follow](#follow)
    - [unFollow](#unfollow)
    - [Check if Is follow of](#check-if-is-follow-of)
    - [Get Lists of followers](#get-lists-of-followers)
    - [Count Followers](#count-followers)
    - [Note](#note)
    - [Tests](#tests)
    - [Credits](#credits)

Installation
------------

[](#installation)

### Step 1

[](#step-1)

Add it on your composer.json

```
"fenos/rally": "1.0.*"

```

and run **composer update**

### Step 2

[](#step-2)

Add the following string to **app/config/app.php**

**Providers array:**

```
'Fenos\Rally\RallyServiceProvider'

```

**Aliases array:**

```
'Rally'    => 'Fenos\Rally\Facades\Rally'

```

### Step 3

[](#step-3)

#### Migration

[](#migration)

Make sure that your settings on **app/config/database.php** are correct, then make the migration typing:

```
php artisan migrate --package="fenos/rally"

```

### Step 4

[](#step-4)

#### Include relations

[](#include-relations)

Rally comes with some relations already setted for you, you just need to insert the `trait` that I made for you in all your models you wish to have relations with Rally.

```

class User extends Eloquent
{
    use \Fenos\Rally\Models\Relations;
}

```

That's it your have done.

Documentation
-------------

[](#documentation)

How i said on the installation, Rally can be **Polymorphic**, it means that if you have `Users` and `Teams` as entity of your application they can follow between them. But it is just up to you. If you realize that you don't need of it, You can keep it as a single model binding.

The key to enable or disable the polymorphic relation is in the configuration files. You just need to push them and change the key polymorphic to `true`. if instead you want to keep the plugin as 1 model but the `User` model is not your main model change it ;)

```
php artisan config:publish fenos/rally

```

### Follow

[](#follow)

For start to be followers of a entity when it comes polymorphically you will use the following method let me show you.

```
try
{
    Rally::follower('User',$user_id)->follow('Team',$team_id);
}
catch(\Fenos\Rally\Exceptions\AlreadyFollowerException $e)
{
    // is already fan
}

```

With only fews line of code the user has started to follow the team.

If instead you use **Rally** as normal

```
try
{
    Rally::follower($user_id)->follow($user_id);
}
catch(\Fenos\Rally\Exceptions\AlreadyFollowerException $e)
{
    // is already follower
}

```

Let me explain it. The method `follower()` specify the user that want to be follower, so if Rally comes polymorphically you have to specify as `first paramter` The model of it, as `second parameter` the id if instead is not polymorphically just the ID. Almost same the method `follow()` in this method you specify who will be followed parameters are same.

### UnFollow

[](#unfollow)

If you don't want follow someone anymore you will use this method:

**Polymorphically**

```
try
{
    Rally::follower('User',$user_id)->unFollow('Team',$team_id);
}
catch(\Fenos\Rally\Exceptions\FollowerNotFoundException $e)
{
    // the user already doesn't follow him
}

```

**Normal**

```
try
{
    Rally::follower($user_id)->unFollow($user_id);
}
catch(\Fenos\Rally\Exceptions\FollowerNotFoundException $e)
{
    // the user already doesn't follow him
}

```

### Check if Is follow of

[](#check-if-is-follow-of)

If you want to know a given User if has following someone use:

**Polymorphically**

```
Rally::follower('User',$user_id)->isFollowerOf('Team',$team_id);

```

**Normal**

```
Rally::follower($user_id)->isFollowerOf($user_id); // return Boolean

```

### Get lists of followers

[](#get-lists-of-followers)

Well Rally give to you a easy way to get the lists of your followers but remeber that you implemented the `trait` with the relations in your model, So you can even access to them directly from that, I suggest that. But let me show you if you want use Rally.

**Polymorphically**

```
Rally::follower('User',$user_id)->getLists();

Rally::follower('User',$user_id)->getLists(['orderBy' => 'DESC', 'limit' => 10]);

Rally::follower('User',$user_id)->getLists(['orderBy' => 'DESC', 'paginate' => 5 ]);

```

**Normal**

```
Rally::follower($user_id)->getLists();

Rally::follower($user_id)->getLists(['orderBy' => 'DESC', 'limit' => 10]);

Rally::follower($user_id)->getLists(['orderBy' => 'DESC', 'paginate' => 5 ]);

```

You can even chain `count()` it return a Collection so you can use all the methods of it.

#### Count Followers

[](#count-followers)

You Need just the numbers of followers and nothing else?

**Polymorphically**

```
Rally::follower('User',$user_id)->count();

```

**Normal**

```
Rally::follower($user_id)->count();

```

I hope you'll enjoy it.

### Note

[](#note)

I made it with &lt;3

### Tests

[](#tests)

For run the tests make sure to have phpUnit and Mockery installed

### Credits

[](#credits)

© Copyright Fabrizio Fenoglio

Released package under MIT Licence.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 83.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~25 days

Total

10

Last Release

4232d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

1.0.2PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab9e036805ae0f49f15155a92bd8e949032f04cbb54ff82a632ee333c25fe505?d=identicon)[slypver3](/maintainers/slypver3)

---

Top Contributors

[![fenos](https://avatars.githubusercontent.com/u/4754064?v=4)](https://github.com/fenos "fenos (26 commits)")[![Atorich](https://avatars.githubusercontent.com/u/944546?v=4)](https://github.com/Atorich "Atorich (2 commits)")[![summerblue](https://avatars.githubusercontent.com/u/324764?v=4)](https://github.com/summerblue "summerblue (2 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (1 commits)")

---

Tags

laravelFollowFollowers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fenos-rally/health.svg)

```
[![Health](https://phpackages.com/badges/fenos-rally/health.svg)](https://phpackages.com/packages/fenos-rally)
```

###  Alternatives

[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[rennokki/befriended

Eloquent Befriended brings social media-like features like following, blocking and filtering content based on following or blocked models.

76292.2k1](/packages/rennokki-befriended)[lecturize/laravel-followers

Build a poly-morph Follower system or simply associate Eloquent models in Laravel 5.

131.4k](/packages/lecturize-laravel-followers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
