logs() ->with('author') ->orderBy('created_at', 'desc') ->paginate(15); $logsCollection = collect(); foreach ($logs as $log) { $description = trans('logs.contact_log_'.$log->action); $logsCollection->push([ 'author_name' => ($log->author) ? $log->author->name : $log->author_name, 'description' => $description, 'audited_at' => DateHelper::getShortDateWithTime($log->audited_at), ]); } return view('people.auditlogs.index') ->withContact($contact) ->withLogs($logsCollection) ->withLogsPagination($logs); } }