定制 admn/admn-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

admn/admn-laravel

Composer 安装命令:

composer require admn/admn-laravel

包简介

Laravel Package To Interact With ADMN Service

README 文档

README

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

Features

  • Log action as entity (User, Customer, Employee, etc. Any Model you apply our Trait to)

Requirements

  • PHP 7+
  • ADMN PHP SDK (automatically installed via Composer dependency)

Installation

Via Composer.

composer require admn/admn-laravel

php artisan vendor:publish --provider="Admn\Admn\AdmnServiceProvider"

Model Configuration

<?php 

namspace App\Models;

class User extends Authenticatable {
    ...
    use \Admn\Admn\PerformsActions;
    ...
        
    /**
     * How we display the entity in our interface 
     * @return string
     */
    protected function getAuditDisplayValue()
    {
        return $this->name;
    }
    
    /**
    * Key used to identify the entity in our platform 
    * @return string
    */
    protected function getAuditIdentifierKey()
    {
         return 'email';
    }
    
    /**
     * Value used to identify the entity in our platform 
     * @return string|int
     */
    protected function getAuditIdentifierValue()
    {
        return $this->email;
    }
}

Usage

    $user = User::find(1);

    $user->logAction('Updated post title',['post:123'],['title' => 'My new title']);

    //OR in PHP 8.0+
    $user->logAction(
        action: 'Updated post title',
        tags: [
            'post:123'
        ],
        context: [
            'title' => 'My new title'
        ]
    );

Coming Soon

  • Ability to retrieve actions from the API for an actor
  • Ability to offload action recording to queue
  • Ability to select a region (as more regions become available)

统计信息

  • 总下载量: 396
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-01-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固