diff --git a/app/Http/Controllers/Consumables/ConsumablesController.php b/app/Http/Controllers/Consumables/ConsumablesController.php index 5685944a5c..9dd17fe6bc 100644 --- a/app/Http/Controllers/Consumables/ConsumablesController.php +++ b/app/Http/Controllers/Consumables/ConsumablesController.php @@ -200,7 +200,7 @@ class ConsumablesController extends Controller */ public function show($consumableId = null) { - $consumable = Consumable::find($consumableId); + $consumable = Consumable::withCount('users as users_consumables')->find($consumableId); $this->authorize($consumable); if (isset($consumable->id)) { return view('consumables/view', compact('consumable')); diff --git a/resources/views/consumables/view.blade.php b/resources/views/consumables/view.blade.php index 512d387031..402edd707b 100644 --- a/resources/views/consumables/view.blade.php +++ b/resources/views/consumables/view.blade.php @@ -3,7 +3,7 @@ {{-- Page title --}} @section('title') {{ $consumable->name }} - {{ trans('general.consumable') }} + {{ trans('general.consumable') }} - ({{ trans('general.remaining_var', ['count' => $consumable->numRemaining()]) }}) @parent @endsection @@ -38,10 +38,10 @@
  • -
  • @@ -190,6 +190,18 @@ @endif + + @if ($consumable->min_amt) +
    +
    + {{ trans('general.min_amt') }} +
    +
    + {{ $consumable->min_amt }} +
    +
    + @endif + @if ($consumable->location)
    @@ -248,7 +260,7 @@ - +
    @endif