@extends('admin.layout') @section('title', 'SubCategory') @section('header') @endsection @section('content')

Create SubCategory

@csrf
{{-- Parent Category Dropdown --}}
{{-- Subcategory Name --}}

Click to Upload

( Max file size: 1 MB )
{{-- Submit --}}
@php $sn = 1; @endphp @foreach ($category_list as $category) @endforeach
SN CATEGORY NAME SUBCATEGORY NAME SUBCATEGORY NAME IN TAMIL PREVIEW CREATED DATE ACTION
{{ $loop->iteration }} {{ $category->category_name}} {{ $category->subcategory_name }} {{ $category->subcat_name }} @php $subcategoryImageUrl = null; $digitalOceanBaseUrl = 'https://dstone.sfo3.digitaloceanspaces.com'; if ( !empty( $category->subcategory_image ) ) { $storedImage = ltrim( trim( $category->subcategory_image ), '/' ); /* |-------------------------------------------------------------------------- | Already full URL |-------------------------------------------------------------------------- */ if ( str_starts_with( $storedImage, 'http://' ) || str_starts_with( $storedImage, 'https://' ) ) { $subcategoryImageUrl = $storedImage; /* |-------------------------------------------------------------------------- | New DigitalOcean path |-------------------------------------------------------------------------- | icons/1784800073_images.jpg |-------------------------------------------------------------------------- */ } elseif ( str_starts_with( $storedImage, 'icons/' ) ) { $subcategoryImageUrl = rtrim( $digitalOceanBaseUrl, '/' ) . '/' . $storedImage; /* |-------------------------------------------------------------------------- | Old local path |-------------------------------------------------------------------------- | assets/uploads/icons/image.png |-------------------------------------------------------------------------- */ } else { $subcategoryImageUrl = asset($storedImage); } } @endphp @if($subcategoryImageUrl) {{ $category->subcategory_name ?? 'Subcategory image' }} @else Null @endif {{ $category->created_at->format('Y-m-d') }}
@endsection @section('footer') @endsection