Browse Source

adding some additional fields to beer stuff

master
jk 3 years ago
parent
commit
10640e645d
  1. 32
      app/Http/Controllers/SummarieController.php
  2. 8
      resources/views/beer.blade.php
  3. 16
      resources/views/beers/create.blade.php
  4. 15
      resources/views/beers/edit.blade.php

32
app/Http/Controllers/SummarieController.php

@ -64,6 +64,22 @@ class SummarieController extends Controller
{
$beer->notes = $request->input('notes');
}
if ($request->input('boil_volume'))
{
$beer->boil_volume = $request->input('boil_volume');
}
if ($request->input('ebc'))
{
$beer->ebc = $request->input('ebc');
}
if ($request->input('srm'))
{
$beer->srm = $request->input('srm');
}
if ($request->input('ph'))
{
$beer->ph = $request->input('ph');
}
$beer->save();
return redirect('/beers')->with('success', 'Beer Added');
@ -108,6 +124,22 @@ class SummarieController extends Controller
{
$beer->notes = $request->input('notes');
}
if ($request->input('boil_volume'))
{
$beer->boil_volume = $request->input('boil_volume');
}
if ($request->input('ebc'))
{
$beer->ebc = $request->input('ebc');
}
if ($request->input('srm'))
{
$beer->srm = $request->input('srm');
}
if ($request->input('ph'))
{
$beer->ph = $request->input('ph');
}
$beer->save();
return redirect('/beers')->with('success', 'Beer updated!');

8
resources/views/beer.blade.php

@ -17,6 +17,9 @@
<th scope="col">ABV %</th>
<th scope="col">OG</th>
<th scope="col">FG</th>
@if($beer->ebc)<th scope="col">EBC</th>@endif
@if($beer->srm)<th scope="col">SRM</th>@endif
@if($beer->ph)<th scope="col">pH</th>@endif
</tr>
</thead>
@ -26,6 +29,9 @@
<td>{{$beer->abv}} </td>
<td>{{$beer->og}} </td>
<td>{{$beer->fg}} </td>
@if($beer->ebc)<td>{{$beer->ebc}} </td>@endif
@if($beer->srm)<td>{{$beer->srm}} </td>@endif
@if($beer->ph)<td>{{$beer->ph}} </td>@endif
</tr>
</tbody>
</table>
@ -96,7 +102,7 @@
@endforeach
@foreach ($mashsteps as $mash)
@if($mash->stage == 1)
<tr><td colspan="3"><center><b>Boil: {{$mash->boil}} minutes</b></center></td></tr>
<tr><td colspan="3"><center><b>Boil: {{$mash->boil}} minutes@if($beer->boil_volume)<br/>Boil Volume: {{$beer->boil_volume}}L@endif</b></center></td></tr>
@endif
@endforeach
</tbody>

16
resources/views/beers/create.blade.php

@ -65,6 +65,22 @@
<input type="text" class="form-control" name="batch">
</div>
<div class="form-group">
<label for="boil_volume">Boil Volume (L)</label>
<input type="text" class="form-control" name="boil_volume">
</div>
<div class="form-group">
<label for="ebc">EBC</label>
<input type="text" class="form-control" name="ebc">
</div>
<div class="form-group">
<label for="srm">SRM</label>
<input type="text" class="form-control" name="srm">
</div>
<div class="form-group">
<label for="ph">pH</label>
<input type="text" class="form-control" name="ph">
</div>
<div class="form-group">
<label for="mine">Mine?</label>
<input type="checkbox" class="form-control" name="mine" checked>
</div>

15
resources/views/beers/edit.blade.php

@ -57,6 +57,21 @@
<label for="batch">Batch Size (L)</label>
<input type="text" class="form-control" name="batch" value="{{ $beer->batch }}" />
</div>
<label for="boil_volume">Boil Volume (L)</label>
<input type="text" class="form-control" name="boil_volume" value="{{ $beer->boil_volume }}" />
</div>
<div class="form-group">
<label for="ebc">EBC</label>
<input type="text" class="form-control" name="ebc" value="{{ $beer->ebc }}" />
</div>
<div class="form-group">
<label for="srm">SRM</label>
<input type="text" class="form-control" name="srm" value="{{ $beer->srm }}" />
</div>
<div class="form-group">
<label for="ph">pH</label>
<input type="text" class="form-control" name="ph" value="{{ $beer->ph }}" />
</div>
<div class="form-group">
<label for="mine">Mine?</label>
<input type="checkbox" class="form-control" name="mine" value={{ $beer->mine }} />

Loading…
Cancel
Save