/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $productSubCategoryList = ProductSubCategory::all(); return view('product_sub_category.productSubCategoryList', ['productSubCategories' => $productSubCategoryList]); }
public function allProductsApi() { $productList = Product::all(); $categories = ProductSubCategory::all(); foreach ($categories as $category) { } return response()->json(['response_message' => 'success', 'response_rows' => sizeof($productList), 'response_data' => $productList]); }