admn / admn-laravel
此包最新版本(1.3.12)没有可用的许可信息。
Laravel 与 ADMN 服务交互的包
1.3.12
2022-09-14 00:40 UTC
Requires
- admn/admn-php: 1.0.13
- dev-master
- 1.3.12
- 1.3.10
- 1.3.9
- 1.3.8
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.31
- 1.2.30
- 1.2.29
- 1.2.28
- 1.2.27
- 1.2.26
- 1.2.25
- 1.2.24
- 1.2.23
- 1.2.22
- 1.2.21
- 1.2.20
- 1.2.19
- 1.2.18
- 1.2.17
- 1.2.16
- 1.2.15
- 1.2.14
- 1.2.13
- 1.2.12
- 1.2.11
- 1.2.10
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2
- 1.1
- 1.0
This package is auto-updated.
Last update: 2024-09-14 05:08:59 UTC
README
这是一个简单的 ADMN.io API 包装器,用 PHP 编写,适用于 Laravel。
功能
- 将操作记录为实体(用户、客户、员工等。任何应用了我们的Trait的模型)
要求
- PHP 7+
- ADMN PHP SDK(通过 Composer 依赖自动安装)
安装
通过 Composer。
composer require admn/admn-laravel
php artisan vendor:publish --provider="Admn\Admn\AdmnServiceProvider"
模型配置
<?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; } }
使用
$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' ] );
即将推出
- 能够从 API 获取动作的检索能力
- 能够将动作记录卸载到队列
- 能够选择区域(随着更多区域变得可用)