vendredi 21 mai 2021

Trying to access array offset on value of type null (View: C:\xampp\htdocs\pro3\ecommerce\resources\views\backend\category\sub_subcategory_view.blade [duplicate]

the sub_subcategory_view page doesn't open i works in aonther page i just copied the same code in that page and pasted in this page to customize it

enter image description here

this in the buttom in sidebar page when i click on it it should take me to sub_subcategory view it's work but with error

  <li class=""><a href=""><i class="ti-more"></i>All Sub->SubCategory</a></li>

this is the route

Route::prefix('category')->group(function(){
 

    // admin Sub subcategory all route
    Route::get('/sub/sub/view',[SubCategoryController::class,'SubSubCategoryView'])->name('all.subsubcategory');
    });

this sub_subcategory_view.blade.php page

@extends('admin.admin_master')
@section('admin')
 
      <div class="container-full">
        <!-- Content Header (Page header) -->
        
 
        <!-- Main content -->
        <section class="content">
          <div class="row">
              
        
        
 
            <div class="col-8">
 
             <div class="box">
                <div class="box-header with-border">
                  <h3 class="box-title">Sub->SubCategory List</h3>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <div class="table-responsive">
                      <table id="example1" class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>Category </th>
                                <th>SubCategory Name</th>
                                <th>Sub-Category Name English</th>
                                
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                          @foreach($subsubcategory as $item)
     <tr>
        <td>   </td>
        <td></td>
         <td></td>
        <td width="30%">
 <a href="" class="btn btn-info" title="Edit Data"><i class="fa fa-pencil"></i> </a>
 
 <a href="" class="btn btn-danger" title="Delete Data" id="delete">
    <i class="fa fa-trash"></i></a>
        </td>                        
     </tr>
      @endforeach
                        </tbody>
                        
                      </table>
                    </div>
                </div>
                <!-- /.box-body -->
              </div>
              <!-- /.box -->         
              <!-- /.box -->          
            </div>
 
<div class="col-4">
 
             <div class="box">
                <div class="box-header with-border">
                  <h3 class="box-title">Add SubCategory</h3>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <div class="table-responsive">
                       <form method="post" action="" >
        @csrf
                       
 
     <div class="form-group">
        <h5>Basic Select <span class="text-danger">*</span></h5>
        <div class="controls">
            <select name="category_id"  class="form-control" >
                <option value="" disabled="" selected="">Select Category</option>
                @foreach($categories as $category)
                <option value=""></option>
                @endforeach
                
            </select>
        <div class="help-block"></div></div>
         @error('category_id') 
     <span class="text-danger"></span>
     @enderror  
    </div>
 
 
    <div class="form-group">
        <h5>SubCategory  English <span class="text-danger">*</span></h5>
        <div class="controls">
     <input type="text" name="subsubcategory_name_en" class="form-control" >
     @error('subsubcategory_name_en') 
     <span class="text-danger"></span>
     @enderror 
      </div>
    </div>
    <div class="form-group">
        <h5>SubCategory  Arabic <span class="text-danger">*</span></h5>
        <div class="controls">
     <input type="text" name="subsubcategory_name_ar" class="form-control" >
     @error('subsubcategory_name_ar') 
     <span class="text-danger"></span>
     @enderror 
      </div>
    </div>
         <div class="text-xs-right">
    <input type="submit" class="btn btn-rounded btn-primary mb-5" value="Add New">                   
                        </div>
                    </form>
                    </div>
                </div>
                <!-- /.box-body -->
              </div>
              <!-- /.box -->
              <!-- /.box -->          
            </div>
 
 <!-- Add sub sub Category Page --> 
            <!-- /.col -->
          </div>
          <!-- /.row -->
        </section>
        <!-- /.content -->
      </div>
      @endsection

this is the subcateegory controller

public function SubSubCategoryView(){
 
     $categories = Category::orderBy('category_name_en','ASC')->get();
        $subsubcategory = SubCategory::latest()->get();
        return view('backend.category.sub_subcategory_view',compact('subsubcategory','categories'));
     }

this is the table

enter image description here

thanks in advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire