PHP code example of seinoxygen / audit-viewer
1. Go to this page and download the library: Download seinoxygen/audit-viewer library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once ('vendor/autoload.php' );
seinoxygen / audit-viewer example snippets
'providers' => [
...
SeinOxygen\AuditViewer\AuditViewerServiceProvider::class,
...
],
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;
}
}
use App \Http \Controllers \BlogController ;
use Illuminate \Support \Facades \Route ;
Route::get('/blog/{model}/audit' , [BlogController::class, 'audit' ]);
bash
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