Files
freeu-project/app/Http/Controllers/GlobalPrivateCreditController.php

45 lines
2.1 KiB
PHP
Raw Normal View History

2024-04-04 19:13:00 +05:30
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Admin\ManageFreeUInvestments\FractionalRealEstateController as FractionalRealEstateFrontendController;
2024-04-05 19:30:15 +05:30
use App\Models\Product;
use App\Models\Fund;
use App\Http\Resources\FractionalRealEstate as test;
2024-04-04 19:13:00 +05:30
class GlobalPrivateCreditController extends Controller
{
public function getGlobalPrivateCreditFundPage()
{
// dd(Product::has('funds')->with('funds')->funds()->globalPrivateCreditFund()->open()->active()->latest()->get());
2024-04-04 19:13:00 +05:30
$learnMore = (new FractionalRealEstateFrontendController)->globalPCFQuestionAndAnswer()->getData();
return view('Frontend.Pages.dummy.global-private-credit', [
'learnMore' => $learnMore,
2024-06-11 13:44:05 +05:30
'openGPCF' => Product::has('funds')->with('funds.companies','categorys')->funds()->globalPrivateCreditFund()->open()->active()->latest()->get(),
// 'resaleGPCF' => Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies', 'categorys')->globalPrivateCreditFund()->resale()->active()->latest()->get(),
2024-06-11 13:44:05 +05:30
'resaleGPCF' => Product::has('funds')->with('funds.companies','categorys')->funds()->globalPrivateCreditFund()->fullyFunded()->active()->latest()->get(),
2024-04-04 19:13:00 +05:30
]);
}
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 {
2024-04-12 12:20:39 +05:30
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);
}
}
2024-04-04 19:13:00 +05:30
}