@section('title', 'Create Announcement')
@extends('layout.admin')
@section('content')
<div class="card">

    <div class="card-body">
        <div class="card-title"></div>
        <form action="{{ route('announcements.store') }}" method="post" enctype="multipart/form-data">
            @csrf
            <fieldset>
                <legend>Create Announcement</legend>
               @if($errors->any())
                <div class="alert alert-danger">
                {!! implode('', $errors->all('<div>:message</div>')) !!}
                </div>
                @endif
                <div class="row mb-3">
                    <div class="col-sm-12 mb-3">
                        <label class="form-label">Title</label>
                        <input type="text" name="title" value="{{old('title')}}" require class="form-control">
                    </div>
                    <div class="col-sm-12 mb-3">
                        <label class="form-label">Announcement date</label>
                        <input type="date" name="announcement_date" value="{{ date('Y-m-d') }}" require class="form-control">
                    </div>
        
                    <div class="col-sm-12 mb-3">
                        <label class="form-label">Description</label>
                        <textarea name="description" id="editor" class="form-control">{{old('description')}}</textarea>
                    </div>
                </div>
            </fieldset>
            <button type="submit" class="btn btn-primary">Save</button>
        </form>
    </div>
</div>
@endsection
