{"id":23144196,"url":"https://github.com/voocx/laravel-rally","last_synced_at":"2026-03-04T03:02:04.443Z","repository":{"id":62532110,"uuid":"105341654","full_name":"voocx/laravel-rally","owner":"voocx","description":"A followers system for laravel 5, Trait for Laravel Eloquent models to allow easy implementation of a \"follow\" or \"like\" or \"favorite\" or \"remember\" or \"subscribe\" feature.","archived":false,"fork":false,"pushed_at":"2018-05-26T15:16:42.000Z","size":28,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T22:59:48.634Z","etag":null,"topics":["favorite","follow","like","remember","subscribe"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voocx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-30T04:26:52.000Z","updated_at":"2021-12-06T07:54:26.000Z","dependencies_parsed_at":"2022-11-02T15:45:59.412Z","dependency_job_id":null,"html_url":"https://github.com/voocx/laravel-rally","commit_stats":null,"previous_names":["voocx/laravel-rally","questocat/laravel-rally"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/voocx/laravel-rally","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voocx%2Flaravel-rally","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voocx%2Flaravel-rally/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voocx%2Flaravel-rally/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voocx%2Flaravel-rally/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voocx","download_url":"https://codeload.github.com/voocx/laravel-rally/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voocx%2Flaravel-rally/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30070479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"online","status_checked_at":"2026-03-04T02:00:07.464Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["favorite","follow","like","remember","subscribe"],"created_at":"2024-12-17T15:15:20.573Z","updated_at":"2026-03-04T03:02:04.424Z","avatar_url":"https://github.com/voocx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravel-rally\n\nA followers system for laravel 5, Trait for Laravel Eloquent models to allow easy implementation of a \"follow\" or \"like\" or \"favorite\" or \"remember\" or \"subscribe\" feature.\n\n[![StyleCI](https://styleci.io/repos/105341654/shield?branch=master)](https://styleci.io/repos/105341654)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/questocat/laravel-rally/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/questocat/laravel-rally/?branch=master)\n[![Build Status](https://travis-ci.org/questocat/laravel-rally.svg?branch=master)](https://travis-ci.org/questocat/laravel-rally)\n[![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg)](https://packagist.org/packages/questocat/laravel-rally)\n\n## Installation\n\nVia [Composer](https://getcomposer.org) to add the package to your project's dependencies:\n\n```bash\n$ composer require questocat/laravel-rally\n```\n\nFirst add service providers into the config/app.php\n\n```php\n\\Questocat\\Rally\\RallyServiceProvider::class,\n```\n\nPublish the migrations\n\n```bash\n$ php artisan vendor:publish --provider=\"Questocat\\Rally\\RallyServiceProvider\" --tag=\"migrations\"\n```\n\nPublish the config\n\n```bash\n$ php artisan vendor:publish --provider=\"Questocat\\Rally\\RallyServiceProvider\" --tag=\"config\"\n```\n\n## Setup the model\n\nAdd CanFollow Traits to your User model.\n\n```php\nuse Questocat\\Rally\\Traits\\CanFollow\n\nclass User extends Model\n{\n    use CanFollow;\n}\n```\n\nAdd CanBeFollowed Trait to your Post model or Video model and more.\n\n```php\nuse Questocat\\Rally\\Traits\\CanBeFollowed\n\nclass Post extends Model\n{\n    use CanBeFollowed;\n}\n```\n\nAdd CanFollow and CanBeFollowed feature trait into your User model:\n\n```php\nuse Questocat\\Rally\\Traits\\Followable\n\nclass User extends Model\n{\n    use Followable;\n}\n```\n\n## Usage\n\n##### CanFollow\n\nFollow and Unfollow users\n\n```php\n$user-\u003efollow(1);  // App\\User:class\n$user-\u003efollow($user1);\n$user-\u003efollow([1, 3]);\n$user-\u003efollow(1, Post::class);\n\n$user-\u003eunfollow(1);  // App\\User:class\n$user-\u003eunfollow($user1);\n$user-\u003eunfollow([1, 2]);\n$user-\u003eunfollow(1, Post::class);\n```\n\nCheck if being followed by someone\n\n```php\n$user-\u003eisFollowing(1);\n$user-\u003eisFollowing($user2);\n$user-\u003eisFollowing(2, Post::class);\n$user-\u003eisFollowing($post, Post::class);\n```\n\nToggle follow\n\n```php\n$user-\u003etoggleFollow(1);\n$user-\u003etoggleFollow($user2);\n$user-\u003etoggleFollow([2, 4]);\n$user-\u003etoggleFollow([2, 4], Post::class);\n```\n\nFollowing\n\n```php\n$user-\u003efollowing;\n$user-\u003efollowing()-\u003eget();    // It's the same thing as this\n$user-\u003efollowing()-\u003ecount();  // Get the total following\n```\n\n##### CanBeFollowed\n\nCheck if following by someone\n\n```php\n$user-\u003eisFollowedBy(3);\n$user-\u003eisFollowedBy($user2);\n```\n\nFollowers\n\n```php\n$user-\u003efollowers;\n$user-\u003efollowers()-\u003eget();    // It's the same thing as this\n$user-\u003efollowers()-\u003ecount();  // Get the total followers\n```\n\n##### Followable\n\nCheck if it is mutual follow\n\n```php\n$user-\u003eisMutualFollow(1);\n$user-\u003eisMutualFollow($user2);\n```\n\n## Inspiration\n\n* [Rally](https://github.com/fenos/Rally)\n\n## License\n\nLicensed under the [MIT license](https://github.com/questocat/laravel-rally/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoocx%2Flaravel-rally","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoocx%2Flaravel-rally","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoocx%2Flaravel-rally/lists"}