I think is better to solve this problem in your controller, try this:
//TheController.php
... whatever code you have in controller...
$seen = [];
$unique_files = [];
foreach($files['folders'] as $file)
if(!isset($seen[$file['file_name']]) {
$seen[$file['file_name'] = true;
$unique_files[] = $file;
}
}
$files['folders'] = $unique_files;
//Then pass $files as usual to your view
In your template file now you have only unique values:
@foreach($files['folders'] as $file)
<tr><td>{{$file['file_name']}}</td></tr>
@endforeach
I hope this works for you