@extends('layouts.app')
@section('content')
<main>
    <header class="alert alert-success">
        <h4 class="container">お知らせ > 過去のお知らせ</h4>
    </header>
    <section id="" class="container mt30 mb50">
        <div class="col-12 col-md-8 offset-0 offset-md-2 mb30">
            <h3 class="text-center alert-success">過去のお知らせ</h3>
        </div>
        <div class="row">
            @forelse($informations as $information)
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <h5 class="text-success">
                    {{ \Carbon\Carbon::parse($information->entry_date)->format('Y年n月j日') }}
                </h5>
            </div>
            <div class="col-12 col-lg-7 mb10">
                <p class="h5 font-weight-normal">
                    {!! nl2br(e($information->user_information_history)) !!}
                </p>
            </div>
            @empty
            <div class="col-12 text-center py-5">
                <p>過去のお知らせはありません。</p>
            </div>
            @endforelse
        </div>
        <div class="d-flex justify-content-center mt-4">
            {{ $informations->links('partials.paging') }}
        </div>
        <div class="col-12 col-md-6 offset-0 offset-md-3 mt-4 mb50">
            <a href="{{ route('mypage', ['management_code' => request()->route('management_code')]) }}" class="btn btn-lg btn-block btn-outline-success">マイページへ戻る</a>
        </div>
    </section>
</main>
@endsection