app/Http/Controllers/SubCategoryController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $subCategories = SubCategory::with('category')->get();
        return view('sub_category.index')->with('subCategories', $subCategories);
    }
public function index ( ) { $ subCategories = SubCategory :: with ( 'category' ) -> get ( ) ; return view ( 'sub_category.index' ) -> with ( 'subCategories' , $ subCategories ) ; }
Display a listing of the resource.
Display a listing of the resource .