ventureDebts()->getData(); $learnMore = (new FractionalRealEstateFrontendController)->ventureDebtQuestionAndAnswer()->getData(); $faqs = (new FractionalRealEstateFrontendController)->ventureDebtQuestionAndAnswerFaqs()->getData(); return view('Frontend.Pages.venture-debts.index',compact('ventureDebts','learnMore','faqs')); } public function product($slug){ $ventureDebts = $this->ventureDebtsData($slug)->getData()->data; $otherVD = VentureDebt::query() ->join('products', 'venture_debts.products_id', 'products.id') ->where('status',true) ->where('slug', '!=', $slug) ->where('categories_id',12) ->get(); // $securitizedDebtInstrument = SecuritizedDebtInstrument::where('slug',$slug)->first(); $productData = VentureDebt::where('slug','=',$slug)->first(); $productData = Product::where('id','=',$productData->products_id)->first(); return view('Frontend.Pages.venture-debts.product',compact('ventureDebts','otherVD','productData')); } public function ventureDebts() { try { return (new test(Product::has('ventureDebt')->with('ventureDebt.companies')->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { return response()->json(['message' => $e->getMessage()], 400); } } public function ventureDebtsData($slug) { try { return (new VentureDebtResource(VentureDebt::where('slug',$slug)->first())) ->response() ->setStatusCode(200); } catch (\Exception $e) { return response()->json(['message' => $e->getMessage()], 400); } } }