@extends('admin.layouts') @section('title', 'Add Product') @section('header') @endsection @section('content')

Add Product

@csrf

Click or drag images to upload

You can upload up to 10 images.
{{-- Load images from session --}} @if (session()->has('newtemp_images')) @foreach (session('newtemp_images') as $img)
@endforeach @endif
@error('images')
{{ $message }}
@enderror @error('images.*')
{{ $message }}
@enderror
@error('category_id') {{ $message }} @enderror
@error('hsn_code') {{ $message }} @enderror
@error('barcode1') {{ $message }} @enderror
@error('barcode2') {{ $message }} @enderror
@if (auth()->user()->role === 'admin') @elseif (in_array(auth()->user()->role, ['sakthi', 'smart_world', 'chendur_traders', 'yoga_naturals', 'branch_admin'])) @php $roleToBranchName = [ 'sakthi' => 'Sakthi Super Mart', 'smart_world' => 'SMARTWORLD', 'chendur_traders' => 'CHENDUR TRADERS', 'yoga_naturals' => 'Yogaa Naturals', 'branch_admin' => auth()->user()->name, ]; $userRole = auth()->user()->role; $branchName = $roleToBranchName[$userRole] ?? null; $userBranch = $branches->firstWhere('branch_name', $branchName); @endphp @else @endif
{{--
--}}
Specialization
@php $oldVariants = old('variants', []); $variantIndex = 1; @endphp @foreach ($oldVariants as $index => $variant)
Variant {{ $variantIndex }}
@php $variantIndex++; @endphp @endforeach
{{-- --}} @endsection