PHPackages                             laravel-interaction/bookmark - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. laravel-interaction/bookmark

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

laravel-interaction/bookmark
============================

User bookmark/unbookmark behaviour for Laravel.

3.5.0(1mo ago)105.0k1[1 issues](https://github.com/laravel-interaction/bookmark/issues)MITPHPPHP ^8.0

Since Feb 9Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/laravel-interaction/bookmark)[ Packagist](https://packagist.org/packages/laravel-interaction/bookmark)[ Docs](https://github.com/laravel-interaction/bookmark)[ RSS](/packages/laravel-interaction-bookmark/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (12)Versions (33)Used By (0)

Laravel Bookmark
================

[](#laravel-bookmark)

User bookmark/unbookmark behaviour for Laravel.

[![Latest Stable Version](https://camo.githubusercontent.com/a87aa5cce16f3111ddf2f78cef6770d2d55cc1593ec0e05eb5debf9bf31686cd/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f626f6f6b6d61726b2f762f737461626c652e737667)](https://packagist.org/packages/laravel-interaction/bookmark)[![Total Downloads](https://camo.githubusercontent.com/59f2ca4b9d2bd4a91d4a7b9b99c76b7da2bdc6c562e0125d6336e73e76852f62/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f626f6f6b6d61726b2f646f776e6c6f616473)](https://packagist.org/packages/laravel-interaction/bookmark)[![Latest Unstable Version](https://camo.githubusercontent.com/11c12307b880c0dcb800dc1e1bc01077015754c35330785a582db88a2e4ace1e/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f626f6f6b6d61726b2f762f756e737461626c652e737667)](https://packagist.org/packages/laravel-interaction/bookmark)[![License](https://camo.githubusercontent.com/7e7091526b0e263087317649644c1228cecbe8110d8c74c98caaca2f3dadbe74/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f626f6f6b6d61726b2f6c6963656e7365)](https://packagist.org/packages/laravel-interaction/bookmark)

Introduction
------------

[](#introduction)

It let people express how they feel about the model(documentation/subject/topic).

[![](https://camo.githubusercontent.com/cc44e2a518da46f2548ecc6e652e60f69d4ff7c504f79c5b3429856041c49952/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545322541442539302d312e326b2d677265656e3f7374796c653d736f6369616c)](https://camo.githubusercontent.com/cc44e2a518da46f2548ecc6e652e60f69d4ff7c504f79c5b3429856041c49952/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545322541442539302d312e326b2d677265656e3f7374796c653d736f6369616c)

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

[](#installation)

### Requirements

[](#requirements)

- [PHP 8.0+](https://php.net/releases/)
- [Composer](https://getcomposer.org)
- [Laravel 8.0+](https://laravel.com/docs/releases)

### Instructions

[](#instructions)

Require Laravel Bookmark using [Composer](https://getcomposer.org).

```
composer require laravel-interaction/bookmark
```

Publish configuration and migrations

```
php artisan vendor:publish --tag=bookmark-config
php artisan vendor:publish --tag=bookmark-migrations
```

Run database migrations.

```
php artisan migrate
```

Usage
-----

[](#usage)

### Setup Bookmarker

[](#setup-bookmarker)

```
use Illuminate\Database\Eloquent\Model;
use LaravelInteraction\Bookmark\Concerns\Bookmarker;

class User extends Model
{
    use Bookmarker;
}
```

### Setup Bookmarkable

[](#setup-bookmarkable)

```
use Illuminate\Database\Eloquent\Model;
use LaravelInteraction\Bookmark\Concerns\Bookmarkable;

class Channel extends Model
{
    use Bookmarkable;
}
```

### Bookmarker

[](#bookmarker)

```
use LaravelInteraction\Bookmark\Tests\Models\Channel;
/** @var \LaravelInteraction\Bookmark\Tests\Models\User $user */
/** @var \LaravelInteraction\Bookmark\Tests\Models\Channel $channel */
// Bookmark to Bookmarkable
$user->bookmark($channel);
$user->unbookmark($channel);
$user->toggleBookmark($channel);

// Compare Bookmarkable
$user->hasBookmarked($channel);
$user->hasNotBookmarked($channel);

// Get bookmarked info
$user->bookmarkableBookmarks()->count();

// with type
$user->bookmarkableBookmarks()->withType(Channel::class)->count();

// get bookmarked channels
Channel::query()->whereBookmarkedBy($user)->get();

// get bookmarked channels doesnt bookmarked
Channel::query()->whereNotBookmarkedBy($user)->get();
```

### Bookmarkable

[](#bookmarkable)

```
use LaravelInteraction\Bookmark\Tests\Models\User;
use LaravelInteraction\Bookmark\Tests\Models\Channel;
/** @var \LaravelInteraction\Bookmark\Tests\Models\User $user */
/** @var \LaravelInteraction\Bookmark\Tests\Models\Channel $channel */
// Compare Bookmarker
$channel->isBookmarkedBy($user);
$channel->isNotBookmarkedBy($user);
// Get bookmarkers info
$channel->bookmarkers->each(function (User $user){
    echo $user->getKey();
});

$channels = Channel::query()->withCount('bookmarkers')->get();
$channels->each(function (Channel $channel){
    echo $channel->bookmarkers()->count(); // 1100
    echo $channel->bookmarkers_count; // "1100"
    echo $channel->bookmarkersCount(); // 1100
    echo $channel->bookmarkersCountForHumans(); // "1.1K"
});
```

### Events

[](#events)

EventFired`LaravelInteraction\Bookmark\Events\Bookmarked`When an object get bookmarked.`LaravelInteraction\Bookmark\Events\Unbookmarked`When an object get unbookmarked.License
-------

[](#license)

Laravel Bookmark is an open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance87

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 93.4% 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 ~60 days

Recently: every ~274 days

Total

32

Last Release

54d ago

Major Versions

0.6.0 → 1.0.0-alpha.12021-08-28

0.6.1 → 1.0.0-alpha.22021-08-31

1.x-dev → 2.0.0-beta.12022-03-10

2.0.0 → 3.0.02022-11-27

PHP version history (3 changes)0.0.1PHP ^7.2 || ^8.0

2.0.0-beta.1PHP ^7.3 || ^8.0

3.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fafa5bffa28dcd722432b244bf3f0bfe773406df29fea295847e2397b95d50b?d=identicon)[zingimmick](/maintainers/zingimmick)

---

Top Contributors

[![zingimmick](https://avatars.githubusercontent.com/u/26657141?v=4)](https://github.com/zingimmick "zingimmick (71 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

bookmarklaravellaravelbookmarkbookmarks

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laravel-interaction-bookmark/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[laracraft-tech/laravel-useful-additions

A collection of useful Laravel additions!

58109.4k](/packages/laracraft-tech-laravel-useful-additions)[glhd/special

1929.4k](/packages/glhd-special)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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