authorize('create', [ProjectComment::class, $project]); $comment = $project->comments()->create([ 'user_id' => auth()->id(), 'message' => $request->message, ]); $audit->log('comment_added', [ 'project_id' => $project->id, 'new_values' => ['comment_id' => $comment->id], ]); return back()->with('success', 'Komen berjaya ditambah.'); } public function destroy( TranscriptionProject $project, ProjectComment $comment, AuditLogService $audit ): RedirectResponse { abort_if($comment->project_id !== $project->id, 404); $this->authorize('delete', $comment); $audit->log('comment_deleted', [ 'project_id' => $project->id, 'old_values' => ['comment_id' => $comment->id], ]); $comment->delete(); return back()->with('success', 'Komen berjaya dipadam.'); } }