Browse Source

fermentations refactor mkIII

master
jk 3 years ago
parent
commit
e79f0eb58f
  1. 4
      app/Http/Controllers/FermentationController.php
  2. 4
      resources/views/fermentations/create.blade.php

4
app/Http/Controllers/FermentationController.php

@ -38,8 +38,8 @@ class FermentationController extends Controller
// create project // create project
$yeast = new Fermentations;
$lastID = Fermentations::orderBy('id','desc')->take(1)->value('id');
$yeast = new Fermentation;
$lastID = Fermentation::orderBy('id','desc')->take(1)->value('id');
$yeast->id = number_format($lastID) + 1; $yeast->id = number_format($lastID) + 1;
$yeast->beer_id = $request->input('beer_id'); $yeast->beer_id = $request->input('beer_id');
$yeast->yeast_id = $request->input('yeast_id'); $yeast->yeast_id = $request->input('yeast_id');

4
resources/views/fermentations/create.blade.php

@ -3,7 +3,7 @@
@section('main') @section('main')
<div class="row"> <div class="row">
<div class="col-sm-12 offset-sm-2"> <div class="col-sm-12 offset-sm-2">
<h1 class="display-3">Add a Grain</h1>
<h1 class="display-3">Add a Fermentation Step</h1>
<div> <div>
@if ($errors->any()) @if ($errors->any())
<div class="alert alert-danger"> <div class="alert alert-danger">
@ -36,7 +36,7 @@
<label for="alternative">Alternative (ID)</label> <label for="alternative">Alternative (ID)</label>
<input type="text" class="form-control" name="alternative"> <input type="text" class="form-control" name="alternative">
</div> </div>
<button type="submit" class="btn btn-primary">Add Grain</button>
<button type="submit" class="btn btn-primary">Add Fermentation Step</button>
</form> </form>
</div> </div>
</div> </div>

Loading…
Cancel
Save