45 lines
2.1 KiB
PHP
45 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Http\Controllers\Admin\ManageFreeUInvestments\FractionalRealEstateController as FractionalRealEstateFrontendController;
|
|
use App\Models\Product;
|
|
use App\Models\Fund;
|
|
use App\Http\Resources\FractionalRealEstate as test;
|
|
|
|
class GlobalPrivateCreditController extends Controller
|
|
{
|
|
public function getGlobalPrivateCreditFundPage()
|
|
{
|
|
// dd(Product::has('funds')->with('funds')->funds()->globalPrivateCreditFund()->open()->active()->latest()->get());
|
|
$learnMore = (new FractionalRealEstateFrontendController)->globalPCFQuestionAndAnswer()->getData();
|
|
return view('Frontend.Pages.dummy.global-private-credit', [
|
|
'learnMore' => $learnMore,
|
|
'openGPCF' => Product::has('funds')->with('funds','categorys')->funds()->globalPrivateCreditFund()->open()->active()->latest()->get(),
|
|
// 'resaleGPCF' => Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies', 'categorys')->globalPrivateCreditFund()->resale()->active()->latest()->get(),
|
|
'resaleGPCF' => Product::has('funds')->with('funds','categorys')->funds()->globalPrivateCreditFund()->fullyFunded()->active()->latest()->get(),
|
|
]);
|
|
}
|
|
|
|
public function getGlobalPrivateCreditFundProduct($slug)
|
|
{
|
|
$ventureCapitalFund = Fund::where('slug', $slug)->first();
|
|
$productData = Fund::where('slug', '=', $slug)->first();
|
|
$productData = Product::where('id', '=', $productData->products_id)->first();
|
|
// dd($ventureCapitalFund);
|
|
return view('Frontend.Pages.venture-capital-funds.product', compact('ventureCapitalFund', 'productData'));
|
|
}
|
|
|
|
public function privateCreditAllData($type = 'Open')
|
|
{
|
|
try {
|
|
return (new test(Product::has('funds')->with('funds','product_images')->where('type', $type)->funds()->globalPrivateCreditFunds()->get()))
|
|
->response()
|
|
->setStatusCode(200);
|
|
} catch (\Exception $e) {
|
|
return response()->json(['message' => $e->getMessage()], 400);
|
|
}
|
|
}
|
|
}
|