admn/admn-php

There is no license information available for the latest version (1.0.13) of this package.

PHP Package To Interact With ADMN Service

1.0.13 2022-08-13 01:38 UTC

This package is auto-updated.

Last update: 2024-04-13 21:44:38 UTC


README

A simple wrapper for ADMN.io API written in PHP.

Features

  • Log action as entity (User, Customer, Employee, etc.)

Requirements

Installation

Via Composer.

Installation:

composer require admn/admn-php

Usage:

use Admn\Admn\AuditLogger;
use Admn\Admn\Actor;

// Set API Token Globally
AuditLogger::setCredentials($token, $secret);

// Create Actor Identifier Object
$actor = (new Actor())->setIdentifier(email, 'john@doe.com')->setDisplay('John Doe');

// Send Action
 return AuditLogger::make($actor)
        )->setAction('Updated a user record')
            ->setTags(['user:123','user-update'])
            ->setContext([
               'key' => 'email',
               'original_value' => 'jane@google.com',
               'updated_value' => 'jane@doe.com',
            ])
            ->save();