@extends('layouts.app') @section('title', 'Menu Items') @section('content')
Add food and drinks, manage ingredients and publish nutrition information.
| Photo | Menu Item | Nutrition | Price | Status | Actions |
|---|---|---|---|---|---|
|
@php
/*
|--------------------------------------------------------------------------
| Image Support
|--------------------------------------------------------------------------
|
| Supports:
|
| 1. Online URL
| https://images.unsplash.com/...
|
| 2. Laravel uploaded image
| menu-items/chicken.jpg
|
*/
$photo = $item->image ?? $item->photo ?? null;
if ($photo) {
if (
\Illuminate\Support\Str::startsWith(
$photo,
['http://', 'https://']
)
) {
$photoUrl = $photo;
} else {
$photoUrl = asset(
'storage/' . ltrim($photo, '/')
);
}
} else {
$photoUrl = null;
}
@endphp
@if($photoUrl)
No photo
@else
No photo
@endif
|
{{-- MENU ITEM --}}
{{ $item->name }}
@if($item->category)
{{ $item->category->name }}
@else
No category
@endif
|
{{-- NUTRITION --}}
@if($item->nutrition_calculated)
{{ number_format(
(float) $item->calories,
0
) }}
kcal
{{ number_format(
(float) $item->protein,
1
) }}
g protein
@if($item->carbs !== null)
{{ number_format(
(float) $item->carbs,
1
) }}
g carbs
@endif
@if($item->fat !== null)
{{ number_format(
(float) $item->fat,
1
) }}
g fat
@endif
@else
Not calculated
@endif
|
{{-- PRICE --}}
{{ optional(auth()->user()->restaurant)->currency ?? '$' }} {{ number_format( (float) $item->price, 2 ) }} | {{-- STATUS --}}@if($item->is_available) Available @else Hidden @endif | {{-- ACTIONS --}}|
| No menu items yet. | |||||