PHPackages                             lorenzofk/laravel-observable - 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. lorenzofk/laravel-observable

ActiveLibrary

lorenzofk/laravel-observable
============================

Boot the Observable classes automatically into the Laravel models

v1.0.0(4y ago)04MITPHPPHP &gt;=7.4

Since Sep 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/lorenzofk/laravel-observable)[ Packagist](https://packagist.org/packages/lorenzofk/laravel-observable)[ RSS](/packages/lorenzofk-laravel-observable/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

laravel-observable
==================

[](#laravel-observable)

[![Banner](https://camo.githubusercontent.com/1eaa8e400b5ece1f0c8c343ef8fad2c030b6e6a6ef713bbe79d63dd9d6f636b5/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532304f627365727661626c652e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6c6f72656e7a6f666b2532466c61726176656c2d6f627365727661626c65267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d4f6273657276652b796f75722b6d6f64656c732b6175746f6d61746963616c6c79266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/1eaa8e400b5ece1f0c8c343ef8fad2c030b6e6a6ef713bbe79d63dd9d6f636b5/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532304f627365727661626c652e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6c6f72656e7a6f666b2532466c61726176656c2d6f627365727661626c65267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d4f6273657276652b796f75722b6d6f64656c732b6175746f6d61746963616c6c79266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

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

[](#installation)

You can install the package via composer:

```
composer require lorenzofk/laravel-observable
```

About
-----

[](#about)

Laravel Observable.

If you work with Laravel, you've probably already needed to use the `Observer` pattern to observe specific events in your `Models`.

So, this package provides an easy way to define one or more `Observer` for your models.

Why to use?
-----------

[](#why-to-use)

I've decided to create this tool to solve a problem we were facing on a big project I work on.

Usually, we have to define the Model and its Observer in the `app/Providers/AppServiceProvider.php` class or even to create a specific `Provider` to define this relationship.

With this `Trait` now we are able to define the `Observer` in the `Model` itself, which is much easier and quicker to do.

Usage
-----

[](#usage)

Use the `Observable` trait in any Eloquent Model, you must also add the `$observer` property. This property must be a `string` or an `array`.

```
use lorenzofk\Observable\Observable;

class User extends Model
{
    use Observable;

    protected $observer = UserObserver::class;
}
```

And that's it! You don't need to do anything else.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Lorenzo Kniss](https://github.com/lorenzofk)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

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

1713d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39777538?v=4)[Lorenzo Fernandez](/maintainers/lorenzofk)[@lorenzofk](https://github.com/lorenzofk)

---

Top Contributors

[![lrnz-nabooki](https://avatars.githubusercontent.com/u/59545226?v=4)](https://github.com/lrnz-nabooki "lrnz-nabooki (12 commits)")[![lorenzofk](https://avatars.githubusercontent.com/u/39777538?v=4)](https://github.com/lorenzofk "lorenzofk (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lorenzofk-laravel-observable/health.svg)

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

PHPackages © 2026

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