
<div class="card-footer card-comment draggable">
    @foreach($avvisi as $avviso)
    <div class="card-comment">
        <div class="row">
            <div class="col-xs">
                <time datetime="{{ date_format(date_create($avviso->creato_il),'Y-m-d') }}" class="icon">
                    <em>{{date_format(date_create($avviso->creato_il),'l')}}</em>
                    <strong>{{date_format(date_create($avviso->creato_il),'F')}}</strong>
                    <span>{{date_format(date_create($avviso->creato_il),'d')}}</span>
                </time> 
            </div>
            <div class="col">
                <div class="comment-text">
                    <span class="username">
                        &nbsp;
                        <span class="text-muted float-right">
                        <img class="img-circle img-sm" src="{{ Gravatar::get(App\Models\User::getUserById($avviso->creato_da)->email)}}" alt="User Image">
                            
                        </span>
                    </span>
                </div>   
            <p>{{ $avviso->avviso }}</p>
            </div>
        </div>
    </div>
    @endforeach
</div>
<div class="panel-footer">
    <form action="{{ Route('newAvviso') }}" method="POST">
        @csrf
        <label for="avviso" class="form-label">Nuovo Avviso:</label>
        <textarea class="form-control" name="avviso"></textarea>
        <input type="hidden" name="creato_da" value="{{ Auth::user()->id }}">
        <input type="submit" name="submit" class="button btn-primary">
    </form>
</div>