PATH:
home
/
lab2454c
/
.trash
/
core
/
resources
/
views
/
admin
/
product
@extends('admin.layouts.app') @section('panel') <div class="card b-radius--10 "> <div class="card-body p-0"> <form action="{{ route('admin.productUpdate', $product) }}" method="POST" enctype="multipart/form-data"> @csrf @method('PUT') @include('admin.product.form') </form> </div> </div> <script> $('select[name=category_id]').on('change',function() { $('select[name=sub_category]').html('<option value="">@lang('Select One')</option>'); var subcategory = $('select[name=category_id] :selected').data('subcategory'); var html = ''; subcategory.forEach(function myFunction(item, index) { if (item.id == {{$product->sub_category_id ?? 0 }}) { html += `<option value="${item.id}" selected>${item.name}</option>` }else{ html += `<option value="${item.id}">${item.name}</option>` } }); $('select[name=sub_category]').append(html); }).change(); </script> @endsection
[+]
image
[-] form.blade.php
[edit]
[-] create.blade.php
[edit]
[-] edit.blade.php
[edit]
[+]
..
[-] index.blade.php
[edit]
[-] report.blade.php
[edit]
[-] detail.blade.php
[edit]