edit.blade.php 1.5 KB

123456789101112131415161718192021222324252627282930
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="px-3">
  4. <div class="col-xxl-6 offset-xxl-2">
  5. <form action="{{ ($contract) ? route('contract.update', $contract) : route('contract.store') }}" method="post">
  6. @csrf
  7. @include('partials.input', ['name' => 'year',
  8. 'type' => 'number',
  9. 'title' => 'Год',
  10. 'required' => true,
  11. 'value' => $contract->year ?? date('Y'),
  12. ])
  13. @include('partials.input', ['name' => 'contract_number', 'title' => 'Номер договора', 'required' => true, 'value' => $contract->contract_number ?? ''])
  14. @include('partials.input', ['name' => 'contract_date', 'type' => 'date','title' => 'Дата договора', 'value' => $contract->contract_date ?? date('Y-m-d'), 'required' => true])
  15. @include('partials.submit', ['deleteDisabled' => (!isset($contract)), 'delete' => ['form_id' => 'deleteContract']])
  16. </form>
  17. @if($contract)
  18. <div class="visually-hidden">
  19. <form action="{{ route('contract.delete', $contract) }}" method="POST" id="deleteContract">
  20. @csrf
  21. @method('DELETE')
  22. </form>
  23. </div>
  24. @endif
  25. </div>
  26. </div>
  27. @endsection