PHPackages                             batuhan/laravel-flaggable - 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. [Database &amp; ORM](/categories/database)
4. /
5. batuhan/laravel-flaggable

ActiveLibrary[Database &amp; ORM](/categories/database)

batuhan/laravel-flaggable
=========================

Trait for Laravel Eloquent models to allow easy implementation of a 'flag' feature.

1.0.0(11y ago)016MITPHPPHP &gt;=5.3.0

Since Apr 23Pushed 11y ago1 watchersCompare

[ Source](https://github.com/batuhan/laravel-flaggable)[ Packagist](https://packagist.org/packages/batuhan/laravel-flaggable)[ Docs](https://smartersoftware.net/packages/laravel-likeable-favorite)[ RSS](/packages/batuhan-laravel-flaggable/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Laravel Flaggable Plugin
========================

[](#laravel-flaggable-plugin)

[![Build Status](https://camo.githubusercontent.com/82b6350a11a5ea4d760c040645fb3bda2504bed0077b8795caf82463541b36bc/68747470733a2f2f7472617669732d63692e6f72672f6261747568616e2f6c61726176656c2d666c61676761626c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/batuhan/laravel-flaggable)[![Latest Stable Version](https://camo.githubusercontent.com/16375cd415a6f8a2f6c545684c533c21682bccad8db3b52a4f3a51c5feb87a94/68747470733a2f2f706f7365722e707567782e6f72672f6261747568616e2f6c61726176656c2d666c61676761626c652f762f737461626c652e737667)](https://packagist.org/packages/batuhan/laravel-flaggable)[![License](https://camo.githubusercontent.com/2206ff9a10998a56363c42facb963885c26428c643c3d2dfaf5ff5f2f6ed2eb3/68747470733a2f2f706f7365722e707567782e6f72672f6261747568616e2f6c61726176656c2d666c61676761626c652f6c6963656e73652e737667)](https://packagist.org/packages/batuhan/laravel-flaggable)

Trait for Laravel Eloquent models to allow easy implementation of a "flag" feature. Only tested with Laravel 5.

#### Composer Install (for Laravel 5)

[](#composer-install-for-laravel-5)

```
composer require batuhan/laravel-flagable "~1.0.0"

```

#### Install and then run the migrations

[](#install-and-then-run-the-migrations)

```
'providers' => array(
	'Conner\Likeable\LikeableServiceProvider',
);
```

```
php artisan vendor:publish --provider="Conner\Likeable\LikeableServiceProvider"
php artisan migrate
```

#### Setup your models

[](#setup-your-models)

```
class Article extends \Illuminate\Database\Eloquent\Model {
	use Conner\Likeable\LikeableTrait;
}

```

#### Sample Usage

[](#sample-usage)

```
$article->flag(); // like the article for current user
$article->flag($myUserId); // pass in your own user id
$article->flag(0); // just add flags to the count, and don't track by user

$article->unflag(); // remove flag from the article
$article->unflag($myUserId); // pass in your own user id
$article->unflag(0); // remove flags from the count -- does not check for user

$article->flagCount; // get count of flags

$article->flags; // Iterable Illuminate\Database\Eloquent\Collection of existing flags

$article->flaged(); // check if currently logged in user flaged the article
$article->flaged($myUserId);

Article::whereflaged($myUserId) // find only articles where user flaged them
	->with('flagCounter') // highly suggested to allow eager load
	->get();

```

#### Credits

[](#credits)

- Robert Conner -

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92% 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

Unknown

Total

1

Last Release

4089d ago

### Community

Maintainers

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

---

Top Contributors

[![rtconner](https://avatars.githubusercontent.com/u/334533?v=4)](https://github.com/rtconner "rtconner (23 commits)")[![batuhan](https://avatars.githubusercontent.com/u/535988?v=4)](https://github.com/batuhan "batuhan (2 commits)")

---

Tags

laraveleloquenttraitflaglikerememberFollowfavoritelikeablelikablefavourite

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/batuhan-laravel-flaggable/health.svg)

```
[![Health](https://phpackages.com/badges/batuhan-laravel-flaggable/health.svg)](https://phpackages.com/packages/batuhan-laravel-flaggable)
```

###  Alternatives

[rtconner/laravel-likeable

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

400396.7k5](/packages/rtconner-laravel-likeable)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k332.0k1](/packages/cybercog-laravel-love)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[watson/validating

Eloquent model validating trait.

9803.5M54](/packages/watson-validating)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.3M19](/packages/bavix-laravel-wallet)[qirolab/laravel-reactions

Implement reactions (like, dislike, love, emotion etc) on Laravel Eloquent models.

19670.3k](/packages/qirolab-laravel-reactions)

PHPackages © 2026

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