PHPackages                             cleaniquecoders/laravel-observers - 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. cleaniquecoders/laravel-observers

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

cleaniquecoders/laravel-observers
=================================

A collection of observer classes that can be use in your Laravel application.

4.4.0(1mo ago)810.2k2[1 PRs](https://github.com/cleaniquecoders/laravel-observers/pulls)6MITPHPPHP ^8.1 | ^8.2 | ^8.3 | ^8.4CI passing

Since Aug 10Pushed 1mo agoCompare

[ Source](https://github.com/cleaniquecoders/laravel-observers)[ Packagist](https://packagist.org/packages/cleaniquecoders/laravel-observers)[ GitHub Sponsors](https://github.com/cleaniquecoders)[ RSS](/packages/cleaniquecoders-laravel-observers/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (16)Versions (15)Used By (6)

[![Latest Stable Version](https://camo.githubusercontent.com/3c9302a7804fe6fb811a7b7d46388cc60af90d14223ead270bef0aa04f60f7d5/68747470733a2f2f706f7365722e707567782e6f72672f636c65616e69717565636f646572732f6c61726176656c2d6f62736572766572732f762f737461626c65)](https://packagist.org/packages/cleaniquecoders/laravel-observers) [![Total Downloads](https://camo.githubusercontent.com/940465341217807fe46e7f0fff75426cff4eecd38252bf0ed933d3ed02dd325f/68747470733a2f2f706f7365722e707567782e6f72672f636c65616e69717565636f646572732f6c61726176656c2d6f62736572766572732f646f776e6c6f616473)](https://packagist.org/packages/cleaniquecoders/laravel-observers) [![License](https://camo.githubusercontent.com/0e661a3894c50ed28d06c5f9185abef4cbb768ce13110fc8130f10edafc16536/68747470733a2f2f706f7365722e707567782e6f72672f636c65616e69717565636f646572732f6c61726176656c2d6f62736572766572732f6c6963656e7365)](https://packagist.org/packages/cleaniquecoders/laravel-observers)

About Your Package
------------------

[](#about-your-package)

A collection of observer classes that can be use in your Laravel application.

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

[](#installation)

1. In order to install `cleaniquecoders/laravel-observers` in your Laravel project, just run the *composer require* command from your terminal:

```
$ composer require cleaniquecoders/laravel-observers

```

2. Then in your `config/app.php` add the following to the providers array:

```
CleaniqueCoders\LaravelObservers\LaravelObserversServiceProvider::class,
```

3. In the same `config/app.php` add the following to the aliases array:

```
'LaravelObservers' => CleaniqueCoders\LaravelObservers\LaravelObserversFacade::class,
```

Usage
-----

[](#usage)

Simply publish the config file:

```
$ php artisan vendor:publish --tag=laravel-observers

```

Then open up `config/observers.php` and register your model to which observer do you want.

Please take note, do check for each observer, what's the requirement for each one of it in order to use it.

### Hashid Observer

[](#hashid-observer)

Make sure your model's table has the `hashslug` column. You may use Blueprint Macro - `$table->hashslug(config('hashids.length'))` - in your migration or use the following:

```
$this->string('hashslug')
	->length(config('hashids.length'))
	->nullable()
	->unique()
	->index();
```

### Reference Observer

[](#reference-observer)

Make sure your model's table has the `hashslug` column. You may use Blueprint Macro - `$table->reference()` - in your migration or use the following:

If you using Blueprint Macro, you can overwrite the label and lenght by pass the first and second argument to the macro:

```
$table->reference('reference_no', 128);
```

By default, the length is `64` and label used is `reference`.

```
$table->string('reference', config('document.length'))
	->nullable()
	->unique()
	->index();
```

Test
----

[](#test)

To run the test, type `vendor/bin/phpunit` in your terminal.

To have codes coverage, please ensure to install PHP XDebug then run the following command:

```
$ vendor/bin/phpunit -v --coverage-text --colors=never --stderr

```

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

[](#contributing)

Thank you for considering contributing to the `cleaniquecoders/laravel-observers`!

### Bug Reports

[](#bug-reports)

To encourage active collaboration, it is strongly encourages pull requests, not just bug reports. "Bug reports" may also be sent in the form of a pull request containing a failing test.

However, if you file a bug report, your issue should contain a title and a clear description of the issue. You should also include as much relevant information as possible and a code sample that demonstrates the issue. The goal of a bug report is to make it easy for yourself - and others - to replicate the bug and develop a fix.

Remember, bug reports are created in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the bug report will automatically see any activity or that others will jump to fix it. Creating a bug report serves to help yourself and others start on the path of fixing the problem.

Coding Style
------------

[](#coding-style)

`cleaniquecoders/laravel-observers` follows the PSR-2 coding standard and the PSR-4 autoloading standard.

You may use PHP CS Fixer in order to keep things standardised. PHP CS Fixer configuration can be found in `.php_cs`.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance91

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

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

Every ~232 days

Recently: every ~377 days

Total

13

Last Release

44d ago

Major Versions

v1.3.0 → v2.0.02020-03-05

v2.0.0 → v3.0.02020-09-09

v3.1.0 → 4.0.02022-02-12

PHP version history (6 changes)v1.0.0PHP &gt;=7.1

v1.2.0PHP &gt;=7.2

v3.0.0PHP &gt;=7.3

4.0.0PHP ^8.0|^8.1

4.2.0PHP ^8.1 | ^8.2 | ^8.3

4.3.0PHP ^8.1 | ^8.2 | ^8.3 | ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/b57069d0f4b634f65eccc6e5d5848990e25968d45ec2cf46d626c6a4658f944b?d=identicon)[nasrulhazim.m](/maintainers/nasrulhazim.m)

---

Top Contributors

[![nasrulhazim](https://avatars.githubusercontent.com/u/10341422?v=4)](https://github.com/nasrulhazim "nasrulhazim (45 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (21 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (17 commits)")

---

Tags

laravelobserverlaravelpackagehashidsobserverReferencehashslug

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cleaniquecoders-laravel-observers/health.svg)

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

###  Alternatives

[vinkla/hashids

A Hashids bridge for Laravel

2.1k13.3M73](/packages/vinkla-hashids)[elfsundae/laravel-hashid

A simple, elegant way to obfuscate your data by generating reversible, non-sequential, URL-safe identifiers.

415246.3k2](/packages/elfsundae-laravel-hashid)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[deligoez/laravel-model-hashid

Generate, Save, and Route Stripe/Youtube-like Hash IDs for Laravel Eloquent Models

16498.0k](/packages/deligoez-laravel-model-hashid)[balping/laravel-hashslug

Package providing a trait to use Hashids on a model

25185.2k2](/packages/balping-laravel-hashslug)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

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