Displaying Logs for a Model
By default, there is a single "Audit Logs" list page. The package can also generate logs for a specific model (class) or a specific record if you define the routes as follows:
use Alberon\NexusAudits\Http\Controllers\AuditLogController;
use App\Models\Example;
Route::can(Permission::ViewExampleAuditLogs)->group(static function() {
Route::get('examples/logs', [AuditLogController::class, 'showAuditsForClass'])
->defaults('class', Example::class)
->name('examples.logs');
Route::get('examples/{example}/logs', [AuditLogController::class, 'showAuditsForModel'])
->defaults('class', Example::class)
->name('examples.example-logs');
});
Then add the appropriate links to the sidebar/section navigation and/or the model "show" page.