<?php

declare(strict_types=1);

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use App\Models\AuditTrail;
use Spatie\Permission\Models\Permission;
use Spatie\Permission\Models\Role;

class AuditTrailController extends Controller
{
    public function index()
    {
		$pageInfo = [
            'title' => 'Audit Trails',
            'sub_title' => 'List of Audit Trails System',
            'path' => url()->current()
        ];

        return view(
            'backend.pages.audit_trail.index',
            [
                // sort by newest
                'data' => AuditTrail::with('user')->orderBy('created_at', 'desc')->get(),
				'pageInfo' => $pageInfo,
            ]
        );
    }
}
