Browse Source

beers refactor mkXI

master
jk 3 years ago
parent
commit
c6f970eccf
  1. 2
      app/Http/Controllers/SummarieController.php
  2. 2
      resources/views/beers/create.blade.php

2
app/Http/Controllers/SummarieController.php

@ -116,7 +116,7 @@ class SummarieController extends Controller
} }
public function create() public function create()
{ {
$lastID = Summarie::orderBy('beer_id','desc')->first()->value('beer_id');
$lastID = Summarie::orderBy('beer_id','desc')->take(1)->value('beer_id');
$beer_id = number_format($lastID) + 1; $beer_id = number_format($lastID) + 1;
return view('beers.create')->with('beer_id', $beer_id); return view('beers.create')->with('beer_id', $beer_id);

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

@ -18,7 +18,7 @@
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label for="beer_id">Beer ID</label> <label for="beer_id">Beer ID</label>
<input type="text" class="form-control" name="beer_id" vale="{{$beer_id}}">
<input type="text" class="form-control" name="beer_id" value="{{$beer_id}}">
</div> </div>
<label for="name">Name</label> <label for="name">Name</label>
<input type="text" class="form-control" name="name"> <input type="text" class="form-control" name="name">

Loading…
Cancel
Save