PHPackages                             ofaws/favorite - 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. ofaws/favorite

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

ofaws/favorite
==============

A Laravel package allowing users to mark as favorite any instance that has a Favoritable trait

1.0.6(1y ago)024MITPHPPHP ^8.4|^8.3

Since Dec 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ofaws/favorite)[ Packagist](https://packagist.org/packages/ofaws/favorite)[ Docs](https://github.com/ofaws/favorite)[ GitHub Sponsors]()[ RSS](/packages/ofaws-favorite/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (8)Versions (8)Used By (0)

Favorites
=========

[](#favorites)

[![Latest Version on Packagist](https://camo.githubusercontent.com/80150ae35eb01a2de144964e1a955ca1ccd3ab77a6eaeb82ea44f11bb1dc2059/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f666177732f6661766f726974652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ofaws/favorite)[![GitHub Tests Action Status](https://camo.githubusercontent.com/543a10715d54e03bff44d5c791bebfea6e45618906fbbc7ce745adecf1696f64/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f666177732f6661766f726974652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/ofaws/favorite/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/8e81cdfef14926fb14caa779bbe675eb69a9a6a33b428d194f7c8d2db601a844/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f666177732f6661766f726974652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/ofaws/favorite/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/181e6082fa8677b4f5bf3ccfbb846e33ace51ca1505f5de33e629258b9ad46b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f666177732f6661766f726974652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ofaws/favorite)

A Laravel package allowing users to mark as favorite any instance that has a Favoritable trait.

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

[](#installation)

You can install the package via composer:

```
composer require ofaws/favorite
```

Then run the installation command:

```
php artisan favorite:install
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="favorite-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="favorite-config"
```

It is very important to set the 'assets' and 'morph\_map' values in the config file

Usage
-----

[](#usage)

Add `HasFavorites` trait to your user model and `CanBeFavorite` trait to assets models. Don't forget to add assets models to 'assets' and 'morph\_map' values in the config file if you aim to use controller provided by this package

In order to use `filtered` scope within package's favorites controller you must ensure that each model using `CanBeFavorite` trait has a `type` column in corresponding table.

You can also add `filterByFavorite()` method to query builder of a model using `CanBeFavorite` trait - it will add the `filtered` filter which can be true or false.

You can check the available endpoints by running the command below. Package will publish the routes while installation.

```
php artisan route:list
```

If you aim to use only the relations set by this package - check the traits to see what features are available.

Testing
-------

[](#testing)

```
composer test
```

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

[](#documentation)

Please see [DOCUMENTATION](DOCUMENTATION.md) for more information on how to use package features.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Olga Fursova](https://github.com/ofaws)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance46

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 88.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

7

Last Release

414d ago

PHP version history (2 changes)1.0.0PHP ^8.4

1.0.2PHP ^8.4|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/14e213fc512404a985c3823c3238abf1dec017122403c2c997aff79f674350a8?d=identicon)[ofaws](/maintainers/ofaws)

---

Top Contributors

[![OFursova](https://avatars.githubusercontent.com/u/29506407?v=4)](https://github.com/OFursova "OFursova (8 commits)")[![ofaws](https://avatars.githubusercontent.com/u/91540029?v=4)](https://github.com/ofaws "ofaws (1 commits)")

---

Tags

laravelfavoriteOlga Fursova

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ofaws-favorite/health.svg)

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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