<!DOCTYPE html>
<html lang="it">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Articoli </title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>

<body>
    <div class="container mt-4">
        <h1 class="mb-4">Articoli </h1>
        <table class="table table-bordered">
            <tbody>
                <!--<pre>{{ print_r($articoliVenduti, true) }}</pre>-->

                @if ($articoli->isEmpty())
                    <tr>
                        <td colspan="6" class="text-center">Nessun articolo trovato.</td>
                    </tr>
                @else
                    @foreach ($articoli as $articolo)
                        @if (isset($articolo->idArticolo))
                            <tr>
                                <td>{{ $articolo->idArticolo }}</td>
                                <td>{{ $articolo->Titolo }}</td>
                                <td>{{ \Carbon\Carbon::parse($articolo->DataPubblicazione)->format('d/m/Y') }}</td>
                            </tr>
                        @endif
                    @endforeach
                @endif
            </tbody>
        </table>
    </div>
</body>

</html>