LAR_Maintenance/app/Http/Controllers/System/AuditController.php
JonatanRek 571df9a0a4 Fixes
2024-07-30 18:13:21 +02:00

33 lines
898 B
PHP

<?php
namespace App\Http\Controllers\System;
use App\Http\Controllers\BaseController;
use App\Models\Activity;
use Illuminate\Support\Str;
class AuditController extends BaseController
{
public function index()
{
//TODO: Clean Up and pagination
$activities = Activity::with(["affected", "user"])->orderByDesc("created_at")->get();
$urls = [];
foreach ($activities as $activity) {
if (!Str::contains($activity->lang_text, "delete")) {
// if(!empty($activity->user)) {
// $urls[$activity->id] = route('admin.users.update', ['user' => $activity->user]);
// continue;
// }
$urls[$activity->id] = "";
}
}
return view('system.audit.index', [
'activities' => $activities,
'urls' => $urls,
]);
}
}