PHPackages                             parallax/observe-relationships - 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. parallax/observe-relationships

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

parallax/observe-relationships
==============================

observe Relationships

1.1(6y ago)0389MITPHP

Since May 5Pushed 6y ago3 watchersCompare

[ Source](https://github.com/parallax/observe-relationships)[ Packagist](https://packagist.org/packages/parallax/observe-relationships)[ Docs](https://parall.ax)[ RSS](/packages/parallax-observe-relationships/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Observe Relationships
=====================

[](#observe-relationships)

This package allows you to configure specific models to trigger update observers for other possible related models. Whilst Laravel does support the `touches` method, you might be using a package model instance where you cannot define the parent -&gt; child relationship, therefore cannot enable `$touches` method. This package does the same thing but controlled via configuration.

E.g. A product might relate to a page, but if the page is change the model doesn't re-index currently. This package allows that to work via config and observes.

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

[](#installation)

```
composer require parallax/observe-relationships
```

Configuration
-------------

[](#configuration)

On installation the configuration file should be published to your `/config` folder. If it is not then run the following:

```
php artisan vendor:publish --provider=Parallax\ObserveRelationship\ObserveRelationshipProvider
```

Inside thie `/config/observe-relationship.php` you will see an empty array of models.

The key is the model you want to watch, then the sub arrays are the models you want to trigger. The required fields for a trigger is `model` and `field`. On a save of the watcher instance it will update the `updated_at` timestamps of the trigger model.

### Example

[](#example)

An example configuration of a `Page` model being watched for a change event that will trigger a `Product` model to be seen as updated is:

```
return [
    'models' => [
        \App\Models\Page::class => [
            [
                'model' => \App\Models\Product::class,
                'field' => 'page_id'
            ]
        ]
    ]
];
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

2201d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41b413127c7499a63bcb5c5ae903bd8961ba29300b6ccbda873e0c4bf06d0a02?d=identicon)[jsefton](/maintainers/jsefton)

---

Top Contributors

[![jsefton](https://avatars.githubusercontent.com/u/4114741?v=4)](https://github.com/jsefton "jsefton (6 commits)")

---

Tags

searchlaraveleloquentalgoliascoutrelationshipobserve

### Embed Badge

![Health badge](/badges/parallax-observe-relationships/health.svg)

```
[![Health](https://phpackages.com/badges/parallax-observe-relationships/health.svg)](https://phpackages.com/packages/parallax-observe-relationships)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[mozex/laravel-scout-bulk-actions

A Laravel Scout extension for bulk importing and flushing of all models.

1033.4k](/packages/mozex-laravel-scout-bulk-actions)

PHPackages © 2026

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