Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Model Recommendation

Laravel Model Recommendation Laravel Package

umutphp/laravel-model-recommendation

A Laravel package that adds recommendation capabilities to your Eloquent models. Track user interactions, then retrieve suggested models using built-in algorithms—ideal for powering "you may also like" features with a simple, expressive API. Includes migrations and traits to get started fa...

View on GitHub
Deep Wiki
Context7

This package generates recommendation list for elequent models. It provides a simple API to work with to generate and list recommendations for a model.

Frequently asked questions about Laravel Model Recommendation
How do I install umutphp/laravel-model-recommendation in a Laravel app?
Install it with Composer using composer require umutphp/laravel-model-recommendation, then publish the package config and migrations. Add the provided trait to the Eloquent models you want to generate recommendations for and run the migrations to create the interaction table. After that you can call the record and fetch API from controllers, listeners, or queued jobs. A sandbox spike is typically doable in well under a day.
Which Laravel and PHP versions does laravel-model-recommendation support?
Version 0.4.0 added Laravel 12 support, and the package targets Laravel 10, 11, and 12 subject to the composer constraints in that release. Laravel 12 implies a PHP 8.2 floor, so check composer.json before assuming it installs on older PHP 8.1 applications. If you are mid-cycle on Laravel 10, confirm the new release widened rather than shifted the illuminate constraints. Diffing composer.json and the CI matrix is the reliable way to confirm.
How do I record a user interaction with an Eloquent model?
You add the package trait to your target models, then call the record API from wherever the interaction happens, such as a controller, event listener, or job. Each recorded interaction is stored as a scored edge between records in the database. Because persistence goes through Eloquent and polymorphic relations, it slots into your existing domain models and authorization patterns. There is no external service or training step involved.
Does laravel-model-recommendation require Redis, a queue, or an ML service?
No. The package is lightweight and database-backed, so it only needs your existing relational database such as MySQL, Postgres, or SQLite. There is no external recommendation service, no ML training pipeline, and no vector store to operate. That keeps the blast radius small and the security review short. Any queue usage is for your own write batching, not a package requirement.
How do I retrieve recommendations for a model?
Recommendations are read back through the package's simple fetch API on the trait-equipped model, returning suggested models via Eloquent. Because results come back as Eloquent models, they compose with your existing scoping and authorization patterns. Confirm during your spike that soft deletes and global scopes are respected in the returned set. You can surface the list directly in a controller for a 'you may also like' style feature.
Is this package suitable for large-scale personalized recommendations?
It is best treated as a heuristic, co-occurrence-style recommendation layer rather than a genuine recommender system. It works well for related items and 'people also liked' suggestions where a relational database is your only infrastructure. If the product requirement is real personalisation at scale, this package is a poor fit and you should look at a dedicated system. Score computation and ranking are database work, so caching and precomputation are your responsibility.
Are the migrations safe to run on an existing production database?
The install is additive: a new interaction table plus trait usage, with no changes to your existing schema. Migrations are publishable, so you can review them before running them against production. You should still verify the exact migration contents in the release you pin, since the package is pre-1.0. Running them in a staging copy first is a sensible precaution.
Will recording interactions hurt performance on high-traffic endpoints?
Yes, potentially. Writing an interaction row per view, like, or click puts write amplification on hot request paths, so plan for batching, queuing, or sampling before using it on busy endpoints. Read-time cost is also database work, and unindexed recommendation queries degrade quickly as the interaction table grows. The package does not ship a documented TTL or pruning story, so retention and cleanup are on you. Caching and precomputation are almost certainly your responsibility.
Is laravel-model-recommendation stable and actively maintained?
It is pre-1.0, so semver allows breaking changes in minor bumps and each release should be treated as potentially breaking. Pin with ^0.4 and read the changelog before every upgrade. Maintenance is active but concentrated around a single primary maintainer, with 0.4.0 marking a first-time contributor. Assume you may eventually need to fork or vendor the package.
What is the test coverage and CI matrix for this package?
The release notes are thin, so the CI matrix and the exact database drivers and Laravel versions exercised are not documented in the overview. You should inspect the repository's CI configuration and test suite directly rather than assume coverage. Checking which DB drivers are tested matters if you run Postgres or SQLite rather than MySQL. This is a quick, worthwhile step before adopting the package.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource