From c6f970eccfd14f73c68fda42353eba67b9b83f00 Mon Sep 17 00:00:00 2001 From: jk Date: Tue, 22 Jun 2021 10:28:54 +0100 Subject: [PATCH] beers refactor mkXI --- app/Http/Controllers/SummarieController.php | 2 +- resources/views/beers/create.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/SummarieController.php b/app/Http/Controllers/SummarieController.php index 59e21d6..95d6957 100644 --- a/app/Http/Controllers/SummarieController.php +++ b/app/Http/Controllers/SummarieController.php @@ -116,7 +116,7 @@ class SummarieController extends Controller } 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; return view('beers.create')->with('beer_id', $beer_id); diff --git a/resources/views/beers/create.blade.php b/resources/views/beers/create.blade.php index 208d29d..d4e68a5 100644 --- a/resources/views/beers/create.blade.php +++ b/resources/views/beers/create.blade.php @@ -18,7 +18,7 @@ @csrf
- +