PHPackages                             insowe/datalogger - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. insowe/datalogger

ActiveLibrary[File &amp; Storage](/categories/file-storage)

insowe/datalogger
=================

Save data logs to Cloud Storage.

v0.3.0-beta(1y ago)062proprietaryPHP

Since Apr 6Pushed 1y ago2 watchersCompare

[ Source](https://github.com/insowe-php/datalogger)[ Packagist](https://packagist.org/packages/insowe/datalogger)[ Docs](https://github.com/insowe-php/datalogger)[ RSS](/packages/insowe-datalogger/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (1)Versions (7)Used By (0)

DataLogger
==========

[](#datalogger)

This package help log the data after every updated, and upload to cloud storage not database to reduce loading of the database.

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

[](#installation)

Via Composer

```
$ composer require insowe/datalogger
```

Execute `php artisan vendor:publish`, choose `Provider: Insowe\DataLogger\DataLoggerServiceProvider` to publish database migration to `~/database/migrations/2020_01_22_023910_create_data_logs_table.php`.

You should put all the data types you need to enum column setting.

```
Schema::create('data_logs', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->enum('data_type', [

    // Put data types of the app here!

    ])->comment('資料類型');

```

For example:

```
Schema::create('data_logs', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->enum('data_type', [
        Model::getDataLogType(),
        Product::getDataLogType(),
        CleaningService::getDataLogType(),
    ])->comment('資料類型');

```

> This package use **queue**, make sure the queue environment is ready, or just let `QUEUE_CONNECTION=sync`.

Usage
-----

[](#usage)

If an `Eloquent Model` will be logged, let it implement the interface `Insowe\DataLogger\Models\IData`.

```
class Model extends BaseModel implements IData
{
    public function getDataLogId()
    {
        return $this->id;
    }

    public static function getDataLogType()
    {
        return 'model';
    }
}

```

Create a `createLog` method in the controller after data has beed updated.

```
public function createOrUpdate(Request $request)
{
    if (intval($request->id) === 0) {
        $item = $this->create($request);
    }
    else {
        $item = $this->update($request);
    }
    $this->createLog($item->id, $request->user()->id);
}

```

In the method `createLog`，get the newest data and trigger the event `Updated`, the listener will add a log row to database and make a queue for upload log file to the cloud.

```
public function createLog($modelId, $userId)
{
    $item = Model::with('brand')
            ->with('type')
            ->with('age')
            ->with('minAge')
            ->with('usages')
            ->with('detail')
            ->with('accessories')
            ->where('id', $modelId)
            ->first();

    $item->setHidden([
        'product_quantity',
        'product_in_stock',
        'updated_at',
        'deleted_at',
    ]);

    event(new Updated($item, $userId));
}

```

> Notice: should hide the **machine-updated columns** like updated\_at, deleted\_at and other **statistics columns**.

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

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

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email author email instead of using the issue tracker.

License
-------

[](#license)

license. Please see the [license file](license.md) for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

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 ~349 days

Recently: every ~436 days

Total

6

Last Release

531d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6625091?v=4)[Insowe](/maintainers/insowe)[@insowe](https://github.com/insowe)

---

Top Contributors

[![insowe-php](https://avatars.githubusercontent.com/u/63229942?v=4)](https://github.com/insowe-php "insowe-php (7 commits)")

---

Tags

laravelInsoweDataLogger

### Embed Badge

![Health badge](/badges/insowe-datalogger/health.svg)

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

###  Alternatives

[laravel/octane

Supercharge your Laravel application's performance.

4.0k26.6M217](/packages/laravel-octane)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11223.5M33](/packages/anourvalar-eloquent-serialize)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.4k](/packages/typicms-base)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3891.8k](/packages/codewithdennis-larament)

PHPackages © 2026

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