定制 seinoxygen/audit-viewer 二次开发

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

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

seinoxygen/audit-viewer

最新稳定版本:v1.0.1

Composer 安装命令:

composer require seinoxygen/audit-viewer

包简介

A simple audit viewer viewer for the package owen-it/laravel-auditing.

README 文档

README

Donate Packagist Downloads

A simple audit viewer viewer for the package owen-it/laravel-auditing.

Installation

Add Audit Viewer as a dependency using the composer CLI:

composer require seinoxygen/audit-viewer

Publishing Assets

php artisan vendor:publish --provider="SeinOxygen\AuditViewer\AuditViewerServiceProvider" --tag=config

php artisan vendor:publish --provider="SeinOxygen\AuditViewer\AuditViewerServiceProvider" --tag=views

php artisan vendor:publish --provider="SeinOxygen\AuditViewer\AuditViewerServiceProvider" --tag=view-components

php artisan vendor:publish --provider="SeinOxygen\AuditViewer\AuditViewerServiceProvider" --tag=translations

Basic Usage

If using < Laravel 5.5, add the AuditViewerServiceProvider to the providers array

'providers' => [
    ...
    SeinOxygen\AuditViewer\AuditViewerServiceProvider::class,
    ...
],

Using your-url.com/audit-viewer you can have access to all audits saved on your database.

Controllers

In your controller you'll need to add the AuditViewContract and the trait HasAudits.

Also you'll need to return the auditable model in the function setModel().

<?php

namespace App\Http\Controllers;

use App\Models\Blog;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use SeinOxygen\AuditViewer\Contracts\AuditViewContract;
use SeinOxygen\AuditViewer\Http\Traits\HasAudits;

class BlogController extends Controller implements AuditViewContract
{
    use HasAudits;

    public function setModel()
    {
        return Blog::class;
    }
}

The trait automatically will add a function called audit($id) to the controller and you'll need to add that route manually to access all models audit.

Routing

You'll need to add routes manually to your controllers.

<?php

use App\Http\Controllers\BlogController;
use Illuminate\Support\Facades\Route;

Route::get('/blog/{model}/audit', [BlogController::class, 'audit']);

License

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

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固