@php // Repository is used downstream for getReplies(). Renamed from // $comments because the controller already assigns $comments to // the array of comments to render — overwriting it with the // repository object made the @foreach below iterate the object's // (empty) public properties instead of the array, so every // Discussion section came up empty regardless of how the comment // was added. $commentsRepo = app()->make(Leantime\Domain\Comments\Repositories\Comments::class); $formUrl = CURRENT_URL; $formHash = md5($formUrl); // Controller may not redirect. Make sure delComment is only added once if (str_contains($formUrl, '?delComment=')) { $urlParts = explode('?delComment=', $formUrl); $deleteUrlBase = $urlParts[0] . '?delComment='; } else { $deleteUrlBase = $formUrl . '?delComment='; } @endphp