{{-- This page is rendered by addAttributes() method in Admin/ProductsController.php --}} @extends('admin.layout.layout') @section('content')

Attributes

{{-- meaning Product attributes --}}

Add Attributes

{{-- Our Bootstrap error code in case of wrong current password or the new password and confirm password are not matching: --}} {{-- Determining If An Item Exists In The Session (using has() method): https://laravel.com/docs/9.x/session#determining-if-an-item-exists-in-the-session --}} @if (Session::has('error_message')) @endif {{-- Displaying Laravel Validation Errors: https://laravel.com/docs/9.x/validation#quick-displaying-the-validation-errors --}} @if ($errors->any()) @endif {{-- Displaying The Validation Errors: https://laravel.com/docs/9.x/validation#quick-displaying-the-validation-errors AND https://laravel.com/docs/9.x/blade#validation-errors --}} {{-- Determining If An Item Exists In The Session (using has() method): https://laravel.com/docs/9.x/session#determining-if-an-item-exists-in-the-session --}} {{-- Our Bootstrap success message in case of updating admin password is successful: --}} @if (Session::has('success_message')) @endif
@csrf
  {{ $product['product_name'] }}
  {{ $product['product_code'] }}
  {{ $product['product_color'] }}
  {{ $product['product_price'] }}
{{-- Show the product image, if any (if exits) --}} @if (!empty($product['product_image'])) {{-- the 'small' image --}} @else {{-- the 'small' image --}} @endif
{{-- Add Remove Input Fields Dynamically using jQuery: https://www.codexworld.com/add-remove-input-fields-dynamically-using-jquery/ --}} {{-- Products attributes add//remove input fields dynamically using jQuery --}}
{{-- !! Note that the "name" HTML attribute is an ARRAY (using SQUARE BRAKETS [] !!) --}} {{-- !! Note that the "name" HTML attribute is an ARRAY (using SQUARE BRAKETS [] !!) --}} {{-- !! Note that the "name" HTML attribute is an ARRAY (using SQUARE BRAKETS [] !!) --}} {{-- !! Note that the "name" HTML attribute is an ARRAY (using SQUARE BRAKETS [] !!) --}} Add {{-- Add another 4 input fields like the former --}}


Product Attributes

@csrf {{-- DataTable --}} {{-- using the id here for the DataTable --}} @foreach ($product['attributes'] as $attribute) {{-- using the relationship 'attributes' --}} {{-- --}} {{-- A hidden input field --}} {{-- IMPORTANT NOTE: DIDN'T WORK INSIDE FOR LOOP!! MUST BE OUSTSIDE IT IN ORDER TO WORK! --}} {{-- A hidden input field --}} @endforeach
ID Size SKU Price Stock Actions
{{ $attribute['id'] }} {{ $attribute['size'] }} {{ $attribute['sku'] }} {{-- !! Note the "name" HTML attribute SQUARE BRACKETS [] !! --}} {{-- !! Note the "name" HTML attribute SQUARE BRACKETS [] !! --}} @if ($attribute['status'] == 1) {{-- Using HTML Custom Attributes. Check admin/js/custom.js --}} {{-- Icons from Skydash Admin Panel Template --}} @else {{-- if the admin status is inactive --}} {{-- Using HTML Custom Attributes. Check admin/js/custom.js --}} {{-- Icons from Skydash Admin Panel Template --}} @endif
@include('admin.layout.footer')
@endsection