@php
    $count_linked = 0;
    $count_total = 0;
@endphp
@foreach(array_diff(scandir(storage_path('files')), ['.', '..']) as $file)
    @if(\App\Models\Download::where('path', $file)->first())
        @php $count_linked ++ @endphp
    @endif
    @php $count_total ++ @endphp
@endforeach
<p>Nombre de fichier stockés : {{ $count_total }}</p>
<p>Nombre de dowload : {{ \App\Models\Download::all()->count() }}</p>
<p>Nombre de fichier associés a un Download : {{ $count_linked }}</p>
<p>Nombre de fichier non associés a un Download : {{ $count_total - $count_linked }} <a href="{{ route('admin.cleanFail') }}">Clean</a></p>
<ul>
    @foreach(array_diff(scandir(storage_path('files')), ['.', '..']) as $file)
    <li>{{ $file }} {!! \App\Models\Download::where('path', $file)->first() ? '<span style="color: green">Oui</span>' : '<span style="color: red">Non</span>' !!} </li>
    @endforeach
</ul>
-----------------------
<h3>Dossier temporaire : <a href="{{ route('admin.cleanTemporary') }}">Clean</a></h3>
<ul>
    @foreach(array_diff(scandir(storage_path('temp')), ['.', '..']) as $file)
        <li>{{ $file }} {!! \App\Models\Download::where('path', $file)->first() ? '<span style="color: green">Oui</span>' : '<span style="color: red">Non</span>' !!} </li>
    @endforeach
</ul>
