New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

cbytedigital/nen7513-audit-logging

NEN 7513-compliant Laravel package for audit logging
1,969
Install
composer require cbytedigital/nen7513-audit-logging:dev-main
PHP:^8.2
License:MIT
Last Updated:Oct 19, 2026
Links: GitHub  ·  Packagist
Maintainer: cbytedigital

Laravel NEN 7513 Audit Logging

PHP from Packagist Latest Version on Packagist Software License Total Downloads

A comprehensive NEN 7513-compliant Laravel package for audit logging, designed specifically for healthcare applications and other environments requiring detailed activity tracking and compliance with Dutch healthcare standards.

This package automatically tracks and logs all user interactions with your Laravel application's data, capturing who, what, when, where, why, and how for complete audit traceability.

Key Features

  • NEN 7513 Compliant - Meets Dutch healthcare logging standards
  • Automatic Logging - Zero-configuration CRUD operation tracking
  • Flexible API - Multiple ways to log: automatic, facade, or trait methods
  • Rich CREATE Logging - Configurable full model data logging on creation
  • Parent-Child Logging - Child model changes automatically log on parent with full context
  • Data Privacy - Automatic masking of sensitive fields
  • Smart Actor Detection - Automatically identifies users, guests, or system processes
  • Retention Management - Configurable cleanup with NEN 7513 compliance
  • Advanced Querying - Powerful filtering and search capabilities
  • Web Dashboard - Beautiful, responsive audit log viewer with export functionality

Installation

Use composer to install this package:

composer require cbytedigital/nen7513-audit-logging

Publish and run the migration:

php artisan vendor:publish --tag=audit-log
php artisan migrate

Quick Start

Add the Auditable trait to any model you want to track:

<?php

use CbyteDigital\Nen7513AuditLogging\Traits\Auditable;
use Illuminate\Database\Eloquent\Model;

class Patient extends Model
{
    use Auditable;
    
    public function getAuditName(): string
    {
        return $this->first_name . ' ' . $this->last_name;
    }
}

That's it! All CRUD operations are now automatically logged:

$patient = Patient::create(['name' => 'John Doe']);     // Logged
$patient->update(['name' => 'John Smith']);             // Logged
$patient->delete();                                     // Logged

Usage Examples

Automatic Logging

// All operations automatically logged with the Auditable trait
$patient = Patient::find(1);
$patient->update(['status' => 'discharged']);

Manual Logging with Facade

use CbyteDigital\Nen7513AuditLogging\Facades\AuditLog;

AuditLog::read($patient, 'Patient medical record accessed');
AuditLog::failed('Unauthorized access attempt')
    ->forActor($user)
    ->read($patient);

Parent-Child Logging

// Child model changes automatically logged on parent
class ClientHistory extends Model 
{
    use ParentAuditable;
    
    protected static function getParentAuditConfig(): array
    {
        return [
            'parent_relation' => 'client',
            'actions' => ['create', 'update', 'delete'],
        ];
    }
}

Documentation

Support

Version Laravel Version PHP Version
1.x ^11.0|^12.0 ^8.2

Testing

Run the tests with:

composer test
# or
php vendor/bin/phpunit

Reviewware

This package is completely free to use. If it makes it to your production environment, we'd love it if you left us a Google review! ⭐

You can find us here: Google review CBYTE

License

The MIT License (MIT). Please see License File for more information.

Related Packages

shkiper/laravel-activity-log

Activity logging package for Laravel 12 applications

16 1
ss-ipg/laravel-auditable

Declarative model audit logging for Laravel using PHP attributes

16,020 0
emran-alhaddad/statamic-logbook

Statamic add-on for system logs and user audit logs stored in a database, with C...

3,979 9
oilstone/logging

A PSR\Log wrapper for handling static log classes that can be enabled/disabled o...

8,336 2
williamug/audited

The only Laravel audit package that ships a complete admin UI — Livewire table,...

1,534 2