@extends('layouts.app')

@section('title', 'CSD')

@section('content')
 <div class="pagetitle">
      <h1>Ajout d'un CSD</h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="index.html">Acceuil</a></li>
          <li class="breadcrumb-item">CSD</li>
          <li class="breadcrumb-item active">Ajout</li>
        </ol>
      </nav>
    </div><!-- End Page Title -->
    <section class="section">
      <div class="row">
        <div class="col-lg-12">
         <div class="card">
  <div class="card-body">
    <h5 class="card-title">Ajouter un CSD</h5>

    <form method="POST" action="{{ route('csds.store') }}">
      @csrf
      <div class="row g-3">
        <div class="col-md-6">
          <label class="form-label">Code</label>
            <input type="text" class="form-control @error('code') is-invalid @enderror" id="code" name="code"  value="{{ old('code') }}" required>
            @error('code')
                <div class="invalid-feedback">{{ $message }}</div>
            @enderror
        </div>
        <div class="col-md-6">
          <label class="form-label">Nom</label>
           <input type="text" class="form-control @error('nom') is-invalid @enderror" id="nom" name="nom"  value="{{ old('nom') }}" required>
        @error('nom')
            <div class="invalid-feedback">{{ $message }}</div>
        @enderror
        </div>
        <div class="col-12">
          <label class="form-label">Description</label>
            <textarea class="form-control @error('description') is-invalid @enderror" id="description" name="description" rows="3" >{{ old('description') }}</textarea>
        @error('description')
            <div class="invalid-feedback">{{ $message }}</div>
        @enderror
        </div>
      </div>
      <div class="mt-3">
        <button type="submit" class="btn btn-success">Enregistrer</button>
  <button type="reset" class="btn btn-secondary">Réinitialiser</button>
      </div>
    </form>
  </div>
</div>

        </div>
      </div>
    </section>
@endsection
