PHPackages                             shipu/watchable - 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. shipu/watchable

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

shipu/watchable
===============

v1.0.0(3y ago)510.9k↓11.1%6MITPHP

Since Jun 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Shipu/watchable)[ Packagist](https://packagist.org/packages/shipu/watchable)[ RSS](/packages/shipu-watchable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Watchable
=========

[](#watchable)

Watchable is a Laravel package where you can easily pick up laravel model event and activity log inside your application.

```
use Shipu\Watchable\Traits\WatchableTrait;

```

```
onModelCreating
onModelCreated
onModelUpdating
onModelUpdated

```

The Package stores all activity in the `activity_logs` table. Here's a demo of how you can use it:

```
activity()->log('Look, I logged something');
```

You can retrieve all activity using the `Shipu\Watchable\Models\Activity` model.

```
Activity::all();

```

Here's a more advanced example:

```
activity()
   ->on($anEloquentModel)
   ->data($storeWhatYouWantTo)
   ->log('Look, I logged something');

$lastLoggedActivity = Activity::all()->last();

$lastLoggedActivity->model; //returns an instance of an eloquent model
$lastLoggedActivity->causer; //returns an instance of your user model
$lastLoggedActivity->remarks; //returns 'Look, I logged something'
```

Here's an example on [event logging](https://docs.spatie.be/laravel-activitylog/v2/advanced-usage/logging-model-events).

```
$user->name = 'updated name';
$user->save();

//updating the newsItem will cause the logging of an activity
$activity = Activity::all()->last();

$activity->remarks; //returns 'User Updated'
$activity->model; //returns the instance of NewsItem that was created
```

Calling `$activity->changes` will return this array:

```
[
   'new' => [
        'name' => 'updated name',
        'text' => 'Lorum',
    ],
    'old' => [
        'name' => 'original name',
        'text' => 'Lorum',
    ],
];
```

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

[](#installation)

You can install the package via composer:

```
composer require shipu/watchable
```

You can optionally publish the config file with:

```
php artisan vendor:publish --provider="Shipu\Watchable\WatchableServiceProvider" --tag="shipu-watchable-config"
```

This is the contents of the published config file:

```
return [
    'audit_columns' => [
        'creator_column' => 'creator',
        'editor_column' => 'editor',
        'default_active' => false,
    ],
    'activity_log' => [
        'model' => \Shipu\Watchable\Models\Activity::class
    ]
];
```

You can publish the migration with:

```
php artisan vendor:publish --provider="Shipu\Watchable\WatchableServiceProvider" --tag="shipu-watchable-migrations"
```

*Note*: The default migration assumes you are using integers for your model IDs. If you are using UUIDs, or some other format, adjust the format of the subject\_id and causer\_id fields in the published migration before continuing.

After publishing the migration you can create the `activity_logs` table by running the migrations:

```
php artisan migrate
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

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

1419d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/91fdb46a4f45685ae0d448fbc943b1e4a662b56864b17224a65d14c92ee4e247?d=identicon)[shipu](/maintainers/shipu)

---

Top Contributors

[![Shipu](https://avatars.githubusercontent.com/u/4118421?v=4)](https://github.com/Shipu "Shipu (26 commits)")[![dgmashqur](https://avatars.githubusercontent.com/u/96328061?v=4)](https://github.com/dgmashqur "dgmashqur (1 commits)")[![dipokhalder](https://avatars.githubusercontent.com/u/24353577?v=4)](https://github.com/dipokhalder "dipokhalder (1 commits)")[![sagar290](https://avatars.githubusercontent.com/u/7631656?v=4)](https://github.com/sagar290 "sagar290 (1 commits)")

### Embed Badge

![Health badge](/badges/shipu-watchable/health.svg)

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

###  Alternatives

[mad-web/laravel-robots

Robots.txt generator service.

33126.9k](/packages/mad-web-laravel-robots)[sgh/comparable

Provides Comparable and Comparator interfaces and methods to sort and compare objects based on these.

1473.7k2](/packages/sgh-comparable)[elgentos/magento2-structured-data

Implement structured data for Magento 2 webshops.

1444.7k](/packages/elgentos-magento2-structured-data)

PHPackages © 2026

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