@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 class="col-12 col-md-5 offset-md-1 mt10">
                <a href="{{ route('mypage', ['management_code' => request()->route('management_code')]) }}" class="btn btn-lg btn-block btn-outline-success">マイページへ戻る</a>
            </div>
            <div class="col-12 col-md-5 mt10">
                <a href="{{ route('user_information.history', ['management_code' => request()->route('management_code')]) }}" class="btn btn-lg btn-block btn-outline-success">過去のお知らせ</a>
            </div>
        </div>
    </section>
</main>
@endsection