Files
freeu-project/app/Services/Frontend/AIFService.php

252 lines
10 KiB
PHP
Raw Normal View History

2024-03-28 14:52:40 +05:30
<?php
namespace App\Services\Frontend;
use App\Models\Product;
use App\Models\Admin\Tag;
use App\Models\Admin\FAQ;
use App\Traits\HttpResponse;
use App\Http\Resources\FractionalRealEstate as Resource;
class AIFService{
use HttpResponse;
public function products(){
return $this->ventureCapital();
}
//Venture Capital Funds
public function openPCF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->privateCreditFund()->open()->active()->latest()->get());
}
2024-03-28 14:52:40 +05:30
public function openVCF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->ventureCapitalFund()->open()->active()->latest()->get());
}
public function fullyFundedVCF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->ventureCapitalFund()->fullyFunded()->active()->latest()->get());
}
2024-04-04 19:13:00 +05:30
public function resalePCF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->privateCreditFund()->resale()->active()->latest()->get());
2024-03-28 14:52:40 +05:30
}
public function resaleVCF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->ventureCapitalFund()->resale()->active()->latest()->get());
}
public function ventureCapital()
{
try {
return (new Resource(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->ventureCapitalFund()->active()->get()))
->response()
->setStatusCode(200);
} catch (\Exception $e) {
return response()->json(['message' => $e->getMessage()], 400);
}
}
public function ventureCapitalLearnMore(){
return $this->returnData(FAQ::where('tag_id', Tag::VentureCapitalFundId)->active()->get());
}
//Infrastructure Funds
public function openIF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->infrastructureFund()->open()->active()->latest()->get());
}
public function fullyFundedIF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->infrastructureFund()->fullyFunded()->active()->latest()->get());
}
public function resaleIF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->infrastructureFund()->resale()->active()->latest()->get());
}
public function infrastructureFundLearnMore(){
return $this->returnData(FAQ::where('tag_id', Tag::InfrastructureFundId)->active()->get());
}
//Angel Fund
public function openAF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->angelFund()->open()->active()->latest()->get());
}
public function fullyFundedAF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->angelFund()->fullyFunded()->active()->latest()->get());
}
public function resaleAF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->angelFund()->resale()->active()->latest()->get());
}
public function angelFundLearnMore(){
return $this->returnData(FAQ::where('tag_id', Tag::AngelFundId)->active()->get());
}
//Private Equity Fund
public function openPEF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->privateEquityFund()->open()->active()->latest()->get());
}
public function fullyFundedPEF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->privateEquityFund()->fullyFunded()->active()->latest()->get());
}
public function resalePEF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->privateEquityFund()->resale()->active()->latest()->get());
}
public function privateEquityFundLearnMore(){
return $this->returnData(FAQ::where('tag_id', Tag::PrivateEquityFundId)->active()->get());
}
//Private Real Estate Fund
public function openPREF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->privateRealEstateFund()->open()->active()->latest()->get());
}
public function fullyFundedPREF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->privateRealEstateFund()->fullyFunded()->active()->latest()->get());
}
public function resalePREF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->privateRealEstateFund()->resale()->active()->latest()->get());
}
public function privateRealEstateFundLearnMore(){
return $this->returnData(FAQ::where('tag_id', Tag::PrivateRealEstateFundId)->active()->get());
}
//Fund For Distressed Asset
public function openFFDA()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->fundForDistressedAsset()->open()->active()->latest()->get());
}
public function fullyFundedFFDA()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->fundForDistressedAsset()->fullyFunded()->active()->latest()->get());
}
public function resaleFFDA()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->fundForDistressedAsset()->resale()->active()->latest()->get());
}
public function fundForDistressedAssetLearnMore(){
return $this->returnData(FAQ::where('tag_id', Tag::FundForDistressedAssetId)->active()->get());
}
//Hedge Fund
public function openHF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->hedgeFund()->open()->active()->latest()->get());
}
public function fullyFundedHF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->hedgeFund()->fullyFunded()->active()->latest()->get());
}
public function resaleHF()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->hedgeFund()->resale()->active()->latest()->get());
}
2024-04-04 19:47:22 +05:30
//long only equity fund
public function openLOE()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->longOnlyEquityFund()->open()->active()->latest()->get());
}
public function fullyFundedLOE()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->longOnlyEquityFund()->fullyFunded()->active()->latest()->get());
}
public function resaleLOE()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->longOnlyEquityFund()->resale()->active()->latest()->get());
}
//long equity end
2024-03-28 14:52:40 +05:30
public function hedgeFundLearnMore(){
return $this->returnData(FAQ::where('tag_id', Tag::HedgeFundId)->active()->get());
}
//PIPE Fund
public function openPIPE()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->pipe()->open()->active()->latest()->get());
}
public function fullyFundedPIPE()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->pipe()->fullyFunded()->active()->latest()->get());
}
public function resalePIPE()
{
return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies','categorys')->pipe()->resale()->active()->latest()->get());
}
public function pipeLearnMore(){
return $this->returnData(FAQ::where('tag_id', Tag::PrivateInvestmentInPublicEquityFundId)->active()->get());
}
//Debt Fund
// public function openDF()
// {
// return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->debtFund()->open()->active()->latest()->get());
// }
// public function fullyFundedDF()
// {
// return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->debtFund()->fullyFunded()->active()->latest()->get());
// }
// public function resaleDF()
// {
// return $this->returnResponse(Product::has('alternativeInvestmentFund')->with('alternativeInvestmentFund.companies')->debtFund()->resale()->active()->latest()->get());
// }
// public function debtFundLearnMore(){
// return $this->returnData(FAQ::where('tag_id', Tag::DebtFundId)->active()->get());
// }
public function returnData($data)
{
return $data ? $this->apiResponse($data, 200) : $this->apiResponse($data, 400);
}
public function returnResponse($product)
{
try {
return (new Resource($product))
->response()
->setStatusCode(200);
} catch (\Exception $e) {
return response()->json(['message' => $e->getMessage()], 400);
}
}
}