PHPackages                             deegitalbe/laravel-trustup-io-audit - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. deegitalbe/laravel-trustup-io-audit

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

deegitalbe/laravel-trustup-io-audit
===================================

Our package handling audit log creation.

v0.1.3(2y ago)01.3k[1 PRs](https://github.com/deegitalbe/laravel-trustup-io-audit/pulls)MITPHP

Since Jan 30Pushed 2y ago2 watchersCompare

[ Source](https://github.com/deegitalbe/laravel-trustup-io-audit)[ Packagist](https://packagist.org/packages/deegitalbe/laravel-trustup-io-audit)[ RSS](/packages/deegitalbe-laravel-trustup-io-audit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (17)Used By (0)

deegitalbe/laravel-trustup-io-audit
===================================

[](#deegitalbelaravel-trustup-io-audit)

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

[](#installation)

```
sail composer require deegitalbe/laravel-trustup-io-audit
```

.env (non-mandatory)
--------------------

[](#env-non-mandatory)

```
TRUSTUP_IO_AUDIT_URL=
```

🙇 Acknowledgements
------------------

[](#-acknowledgements)

Please add this column to your migration/model. It represent your relation.

Feel free to overide it's name if it enter in conflict with your project.

```
trustup_io_audit_log_uuids
```

🛠️ Default utilisation
----------------------

[](#️-default-utilisation)

```
getAttributes();
        # }
}
```

🛠️ You can also set your custom attributes
------------------------------------------

[](#️-you-can-also-set-your-custom-attributes)

```
custom_attributes
            ];
    }
}
```

🛠️ Default implementation with relation
---------------------------------------

[](#️-default-implementation-with-relation)

### Refer to [laravel-trustup-io-external-model-relation](https://github.com/deegitalbe/laravel-trustup-io-external-model-relations#readme) if you need more documentation on how relations work. Here You will have to define Necessary methods to retrieve your logs.

[](#refer-to-laravel-trustup-io-external-model-relation-if-you-need-more-documentation-on-how-relations-work-here-you-will-have-to-define-necessary-methods-to-retrieve-your-logs)

```
getAttributes();
    }
}
```

🛠️ Custom implementation with relation
--------------------------------------

[](#️-custom-implementation-with-relation)

### Refer to [laravel-trustup-io-external-model-relation](https://github.com/deegitalbe/laravel-trustup-io-external-model-relations#readme) if you need more documentation on how relations work.

[](#refer-to-laravel-trustup-io-external-model-relation-if-you-need-more-documentation-on-how-relations-work)

Preparing your model.
---------------------

[](#preparing-your-model)

```
hasManyExternalModels(app()->make(TrustupIoLogLoadingCallback::class), $this->getTrustupIoAuditLogColumn());
    }

    /** @return Collection */
    public function getTrustupIoAuditLogs(): Collection
    {
        return $this->getExternalModels('trustupIoAuditLogs');
    }

    public function getTrustupIoAuditPayload(): array
    {
        // here you can set all attributes that you want to log for your model
        // It needs to return en array as the return type specify.
        return $this->getAttributes();
    }
}
```

🛠️ Exposing your models by creating a resource
----------------------------------------------

[](#️-exposing-your-models-by-creating-a-resource)

You can use a predefined ressource within the package for your logs.

```
 $this->id,
            'title' => $this->title,
            'text' => $this->text,
            'created_at' => $this->created_at,
            'logs' => LogResource::collection($this->whenExternalRelationLoaded('trustupIoAuditLogs')),
        ];
    }
}
```

🙇 🛠️ Adapter config publish.
----------------------------

[](#-️-adapter-config-publish)

Overide it if necessary as said below

```
sail artisan vendor:publish --provider="Deegitalbe\LaravelTrustupIoAudit\Providers\LaravelTrustupIoAuditServiceProvider" --tag="config"
```

🛠️ Default Adapter config.
--------------------------

[](#️-default-adapter-config)

By default the config use the package Adapter to set some attributes.

If you wish to make your own adapter you can overide it in the config and you should implements the LogServiceAdapterContract.

```
id();
    }

    /** type of the responsible */
    public function getResponsibleType(): string
    {
        return 'user';
    }

    /** account identifier */
    public function getAccountUuid(): ?string
    {
        return null;
    }
    /** Case the log was impersonated by */
    public function getImpersonatedBy(): ?string
    {
        return null;
    }
}
```

⚡ Eager load collections
------------------------

[](#-eager-load-collections)

Only one request will be performed even if you load multiple relations

```
use Illuminate\Routing\Controller;

class PostController extends Controller
{
    public function index()
    {
        return TicketExampleResource::collection(TicketExample::all()->loadExternalRelations('trustupIoAuditLogs'));
    }
}
```

⚡⚡ Migration relation trait.
----------------------------

[](#-migration-relation-trait)

By default the column is set to trustup\_io\_audit\_log\_uuids but feel free to overide it.

```
id();
            $table->uuid('uuid')->nullable();
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
        });
        $this->addAUditLogColumn('users', 'trustup_io_audit_log_uuids');
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
        // $this->removeAuditLogColumn('users', 'trustup_io_audit_log_uuids');
    }
}
```

⚡⚡⚡ TrustupIoAudit facade for.
------------------------------

[](#-trustupioaudit-facade-for)

Available methods on the facade.

```
    public static function prefix(): string
    {
        return "laravel-trustup-io-audit";
    }

    /**
    * Mock laravel audit log.
    * Enabling logging during tests.
    */
    public function mock(): MockInterface
    {
        return $this->logStatus->mock();
    }

    /**
     * Disable Logging
     */
    public function disable(): void
    {
        $this->logStatus->disable();
    }

    /**
     * Enable Logging
     */
    public function enable(): void
    {
        $this->logStatus->enable();
    }

    /**
     * Store given attributes as log manually.
     */
    public function storeAttributes(string $eventName, array $attributes): ?string
    {
        return $this->logService->storeAttributes($eventName, $attributes);
    }

     /**
     * Store given requests as log manually.
     */
    public function storeRequest(StoreLogRequestContract $request): ?string
    {
        return $this->logService->storeRequest($request);
    }
```

⚡⚡⚡⚡ Note by default the package can guess on wich API it need to make request.
-------------------------------------------------------------------------------

[](#-note-by-default-the-package-can-guess-on-wich-api-it-need-to-make-request)

So you don't need to specify any url but just your environement.

```
environment("staging")) return "https://staging.audit.trustup.io";
        if (app()->environment("production")) return "https://audit.trustup.io";

        return "trustup-io-audit";
    }
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.3% 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 ~25 days

Recently: every ~38 days

Total

11

Last Release

918d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24230736?v=4)[Mathieu Henrotay](/maintainers/henrotaym)[@henrotaym](https://github.com/henrotaym)

---

Top Contributors

[![henrotaym](https://avatars.githubusercontent.com/u/24230736?v=4)](https://github.com/henrotaym "henrotaym (17 commits)")[![Pwatup](https://avatars.githubusercontent.com/u/118262799?v=4)](https://github.com/Pwatup "Pwatup (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/deegitalbe-laravel-trustup-io-audit/health.svg)

```
[![Health](https://phpackages.com/badges/deegitalbe-laravel-trustup-io-audit/health.svg)](https://phpackages.com/packages/deegitalbe-laravel-trustup-io-audit)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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