45 lines
2.0 KiB
PHP
45 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Frontend;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use App\Http\Resources\FractionalRealEstate as test;
|
|
use App\Models\Fund;
|
|
use App\Models\Product;
|
|
use App\Http\Controllers\Admin\ManageFreeUInvestments\FractionalRealEstateController as FractionalRealEstateFrontendController;
|
|
|
|
class GlobalHedgeFundController extends Controller
|
|
{
|
|
public function index(){
|
|
$hedgeFunds = $this->hedgeFundAllData()->getData();
|
|
$openGHF = Product::has('funds')->with('funds','categorys')->globalHedgeFund()->open()->active()->latest()->get();
|
|
$resaleGHF = Product::has('funds')->with('funds','categorys')->globalHedgeFund()->resale()->active()->latest()->get();
|
|
$fullyFundedGHF = Product::has('funds')->with('funds','categorys')->globalHedgeFund()->fullyFunded()->active()->latest()->get();
|
|
$learnMore = (new FractionalRealEstateFrontendController)->globalHedgeFundQuestionAndAnswer()->getData();
|
|
// $faqs = (new FractionalRealEstateFrontendController)->globalHedgeFundQuestionAndAnswerFaqs()->getData();
|
|
// dd($openGHF);
|
|
return view('Frontend.Pages.hedge-funds.index',compact('hedgeFunds','learnMore','openGHF','resaleGHF','fullyFundedGHF'));
|
|
}
|
|
|
|
public function product($slug = '')
|
|
{
|
|
$hedgeFund = Fund::where('slug',$slug)->first();
|
|
$productData = Fund::where('slug','=',$slug)->first();
|
|
$productData = Product::where('id','=',$productData->products_id)->first();
|
|
// dd($hedgeFund);
|
|
return view('Frontend.Pages.hedge-funds.product',compact('hedgeFund','productData'));
|
|
}
|
|
|
|
public function hedgeFundAllData()
|
|
{
|
|
try {
|
|
return (new test(Product::has('funds')->with('funds')->funds()->globalHedgeFund()->get()))
|
|
->response()
|
|
->setStatusCode(200);
|
|
} catch (\Exception $e) {
|
|
return response()->json(['message' => $e->getMessage()], 400);
|
|
}
|
|
}
|
|
}
|