Files
freeu-project/app/Http/Controllers/Frontend/GlobalVentureCapitalFund.php

46 lines
2.2 KiB
PHP
Raw Normal View History

2024-03-28 14:52:40 +05:30
<?php
namespace App\Http\Controllers\Frontend;
use App\Http\Controllers\Controller;
use App\Http\Resources\FractionalRealEstate as test;
use App\Models\Product;
use App\Models\Fund;
use Illuminate\Http\Request;
use App\Http\Controllers\Admin\ManageFreeUInvestments\FractionalRealEstateController as FractionalRealEstateFrontendController;
class GlobalVentureCapitalFund extends Controller
{
public function index()
{
$ventureCapital = $this->ventureCapitalAllData()->getData();
2024-06-11 19:01:52 +05:30
$openGVCF = Product::has('funds')->with('funds.companies','categorys')->funds()->globalVentureCapitalFund()->open()->active()->latest()->get();
$resaleGVCF = Product::has('funds')->with('funds.companies','categorys')->funds()->globalVentureCapitalFund()->resale()->active()->latest()->get();
$fullyFundedGVCF = Product::has('funds')->with('funds.companies','categorys')->funds()->globalVentureCapitalFund()->fullyFunded()->active()->latest()->get();
2024-03-28 14:52:40 +05:30
$learnMore = (new FractionalRealEstateFrontendController)->globalVentureCapitalFundQuestionAndAnswer()->getData();
// $faqs = (new FractionalRealEstateFrontendController)->globalVentureCapitalFundQuestionAndAnswerFaqs()->getData();
// dd($openGVCF);
return view('Frontend.Pages.venture-capital-funds.index',compact('ventureCapital','learnMore','openGVCF', 'resaleGVCF', 'fullyFundedGVCF'));
}
public function product($slug = '')
{
$ventureCapitalFund = Fund::where('slug',$slug)->first();
$productData = Fund::where('slug','=',$slug)->first();
$productData = Product::where('id','=',$productData->products_id)->first();
2024-06-12 19:38:09 +05:30
// dd($productData);
2024-03-28 14:52:40 +05:30
return view('Frontend.Pages.venture-capital-funds.product',compact('ventureCapitalFund','productData'));
}
public function ventureCapitalAllData($type = 'Open')
2024-03-28 14:52:40 +05:30
{
try {
2024-06-04 16:10:48 +05:30
return (new test(Product::has('funds')->with('funds','product_images')->where('type',$type)->funds()->globalVentureCapitalFund()->get()))
2024-03-28 14:52:40 +05:30
->response()
->setStatusCode(200);
} catch (\Exception $e) {
return response()->json(['message' => $e->getMessage()], 400);
}
}
}