@extends('layouts.app')

@section('content')
<div class="container app-content">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title m-0">Add Language</h3>
                </div>

                <div class="card-body">
                    <form method="post" action="{{ route('admin.language.store') }}">
                        @csrf
                        <div class="form-group">
                            <label>Locale</label>
                            <input class="form-control @error('locale') is-invalid @enderror" type="text" name="locale" value="{{ old('locale') }}" placeholder="en" required>
                            <small class="form-text text-muted">Use ISO 639-1 codes.</small>
                            @error('locale')
                                <span class="invalid-feedback" role="alert">
                                    <strong>{{ $message }}</strong>
                                </span>
                            @enderror
                        </div>
                        <div class="form-group">
                            <label>Name</label>
                            <input class="form-control @error('name') is-invalid @enderror" type="text" name="name" value="{{ old('name') }}" placeholder="English" required>
                            <small class="form-text text-muted">Insert the name of the language.</small>
                        </div>
                        <button class="btn btn-success" type="submit">Add Language</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
