@extends('layouts.layout-2')
@section('content')
@if ($errors->any())
@foreach ($errors->all() as $error)
- {{ $error }}
@endforeach
@endif
{{ __('Create/Edit Produkt') }}
{!! Form::open(['action' => route('admin_product_store'), 'class' => 'form-horizontal', 'id'=>'']) !!}
{{ __('back') }}
@include('admin.product.form')
{{ __('back') }}
{!! Form::close() !!}
@include('admin.product.images')
@include('admin.product.upload_whitelabel')
@endsection
@section('scripts')
@php
$ingredient_catalog_for_js = $ingredient_catalog->keyBy('id')->map(function ($item) {
return [
'id' => $item->id,
'name' => $item->name,
'inci' => $item->inci,
'effect' => $item->effect,
'default_factor' => $item->default_factor,
'quality_name' => $item->materialQuality?->name ?? '',
];
});
$packaging_catalog_for_js = $packaging_catalog->keyBy('id')->map(function ($item) {
return [
'name' => $item->name,
'weight_grams' => $item->weight_grams,
'material_name' => $item->packagingMaterial?->name ?? '',
];
});
$set_product_catalog_for_js = $set_product_catalog->keyBy('id')->map(function ($item) {
return [
'name' => $item->name,
'number' => $item->number,
'weight' => $item->weight ? $item->weight . ' g' : '—',
'price' => $item->getFormattedPrice() !== '' ? $item->getFormattedPrice() . ' €' : '—',
];
});
@endphp
@endsection