My beer compendium
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
4.3 KiB

  1. @extends('beers')
  2. @section('main') <div class="row">
  3. <div class="col-sm-12">
  4. <h1 class="display-3">Update Beer</h1>
  5. @if ($errors->any())
  6. <div class="alert alert-danger">
  7. <ul>
  8. @foreach ($errors->all() as $error)
  9. <li>{{ $error }}</li>
  10. @endforeach
  11. </ul>
  12. </div>
  13. <br />
  14. @endif
  15. <form method="post" action="{{ route('beers.update', $beer->beer_id) }}">
  16. @method('PATCH')
  17. @csrf
  18. <div class="form-group">
  19. <label for="name">Name</label>
  20. <input type="hidden" class="form-control" name="name" value="{{ $beer->beer_id }}" />
  21. <input type="text" class="form-control" name="name" value="{{ $beer->name }}" />
  22. </div>
  23. <div class="form-group">
  24. <label for="keywords">Keywords</label>
  25. <textarea type="text" class="form-control" name="keywords"/>{{str_replace(' ,',',',str_replace('"',' ',str_replace(',',', ',str_replace('}', '', str_replace('{','',$beer->keywords)))))}}</textarea>
  26. </div>
  27. <div class="Type">
  28. <label for="type">Style</label>
  29. <input type="text" class="form-control" name="type" value="{{ $beer->type }}" />
  30. </div>
  31. <div class="form-group">
  32. <label for="abv">ABV %</label>
  33. <input type="text" maxlength="5" class="form-control" name="abv" value="{{ $beer->abv }}" />
  34. </div>
  35. <div class="form-group">
  36. <label for="og">Original Gravity (OG)</label>
  37. <input type="text" maxlength="8" class="form-control" name="og" value="{{ $beer->og }}" />
  38. </div>
  39. <div class="form-group">
  40. <label for="fg">Final Gravity (FG)</label>
  41. <input type="text" maxlength="8" class="form-control" name="fg" value="{{ $beer->fg }}" />
  42. </div>
  43. <div class="form-group">
  44. <label for="source">Source</label>
  45. <input type="text" class="form-control" name="source" value="{{ $beer->source }}" />
  46. </div>
  47. <div class="form-group">
  48. <label for="notes">Notes</label>
  49. <textarea type="text" class="form-control" name="notes" />{{ $beer->notes }}</textarea>
  50. </div>
  51. <div class="form-group">
  52. <label for="brewery_id">Brewery</label>
  53. <select class="form-control" name="brewery_id">
  54. @foreach ($breweries as $brewery)
  55. <option value="{{$brewery->id}}" {{ $selected_brewery == $brewery->id ? 'selected="selected"' : '' }}>{{$brewery->name}}</option>
  56. @endforeach
  57. </select>
  58. </div>
  59. <div class="form-group">
  60. <label for="batch">Batch Size (L)</label>
  61. <input type="text" class="form-control" name="batch" value="{{ $beer->batch }}" />
  62. </div>
  63. <div class="form-group">
  64. <label for="boil_volume">Boil Volume (L)</label>
  65. <input type="text" class="form-control" name="boil_volume" value="{{ $beer->boil_volume }}" />
  66. </div>
  67. <div class="form-group">
  68. <label for="ibu">IBU</label>
  69. <input type="text" class="form-control" name="ibu" value="{{ $beer->ibu }}" />
  70. </div>
  71. <div class="form-group">
  72. <label for="ebc">EBC</label>
  73. <input type="text" class="form-control" name="ebc" value="{{ $beer->ebc }}" />
  74. </div>
  75. <div class="form-group">
  76. <label for="srm">SRM</label>
  77. <input type="text" class="form-control" name="srm" value="{{ $beer->srm }}" />
  78. </div>
  79. <div class="form-group">
  80. <label for="ph">pH</label>
  81. <input type="text" class="form-control" name="ph" value="{{ $beer->ph }}" />
  82. </div>
  83. <div class="form-group">
  84. <label for="mine">Mine?</label>
  85. <input type="checkbox" class="form-control" name="mine" value={{ $beer->mine }} />
  86. </div>
  87. <button type="submit" class="btn btn-primary">Update</button>
  88. </form>
  89. </div>
  90. </div>
  91. @endsection