46 lines
2.1 KiB
PHP
46 lines
2.1 KiB
PHP
<?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();
|
|
$openGVCF = Product::has('funds')->with('funds','categorys')->funds()->globalVentureCapitalFund()->open()->active()->latest()->get();
|
|
$resaleGVCF = Product::has('funds')->with('funds','categorys')->funds()->globalVentureCapitalFund()->resale()->active()->latest()->get();
|
|
$fullyFundedGVCF = Product::has('funds')->with('funds','categorys')->funds()->globalVentureCapitalFund()->fullyFunded()->active()->latest()->get();
|
|
$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();
|
|
// dd($ventureCapitalFund);
|
|
return view('Frontend.Pages.venture-capital-funds.product',compact('ventureCapitalFund','productData'));
|
|
}
|
|
|
|
public function ventureCapitalAllData()
|
|
{
|
|
try {
|
|
return (new test(Product::has('funds')->with('funds')->funds()->globalVentureCapitalFund()->get()))
|
|
->response()
|
|
->setStatusCode(200);
|
|
} catch (\Exception $e) {
|
|
return response()->json(['message' => $e->getMessage()], 400);
|
|
}
|
|
}
|
|
}
|