Files
freeu-project/app/Http/Controllers/Frontend/GlobalHedgeFundController.php
Ritikesh yadav c661166e1d first commit
2024-03-28 14:52:40 +05:30

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);
}
}
}