reitsAllData()->getData(); $openREITS = Product::has('exchanges')->with('exchanges','categorys')->reits()->open()->active()->latest()->get(); $resaleREITS = Product::has('exchanges')->with('exchanges','categorys')->reits()->resale()->active()->latest()->get(); $fullyFundedREITS = Product::has('exchanges')->with('exchanges','categorys')->reits()->fullyFunded()->active()->latest()->get(); $learnMore = (new FractionalRealEstateFrontendController)->reitQuestionAndAnswer()->getData(); // $faqs = (new FractionalRealEstateFrontendController)->reitQuestionAndAnswerFaqs()->getData(); // dd($openREITS); return view('Frontend.Pages.reits.index',compact('reits','learnMore', 'openREITS', 'resaleREITS', 'fullyFundedREITS')); } public function product($slug = ''){ $reit = StockFundsRealEstateExchange::where('slug',$slug)->first(); $productData = StockFundsRealEstateExchange::where('slug','=',$slug)->first(); $productData = Product::where('id','=',$productData->products_id)->first(); // dd($productData); return view('Frontend.Pages.reits.product',compact('reit','productData')); } public function reitsAllData($type = 'Open') { try { return (new test(Product::has('exchanges')->with('exchanges')->reits()->where('type',$type)->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { return response()->json(['message' => $e->getMessage()], 400); } } }