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

90 lines
3.1 KiB
PHP
Raw Normal View History

2024-03-28 14:52:40 +05:30
<?php
namespace App\Http\Controllers\Frontend;
use App\Models\Product;
use App\Http\Controllers\Controller;
use App\Services\Frontend\GlobalRealEstateService;
use App\Http\Resources\FractionalRealEstate as test;
class GlobalRealAssetController extends Controller
{
protected $gre;
public function __construct(GlobalRealEstateService $gre)
{
$this->gre = $gre;
}
2024-05-15 11:50:32 +05:30
public function index()
{
2024-03-28 14:52:40 +05:30
return view('Frontend.Pages.global-real-estate.index');
}
2024-05-15 11:50:32 +05:30
public function industrial()
{
2024-03-28 14:52:40 +05:30
// dd($this->gre->openGIRE()->getData());
2024-05-15 11:50:32 +05:30
return view('Frontend.Pages.global-real-estate.industrial', [
2024-03-28 14:52:40 +05:30
'openGIRE' => $this->gre->openGIRE()->getData(),
'fullyFundedGIRE' => $this->gre->fullyFundedGIRE()->getData(),
'resaleGIRE' => $this->gre->resaleGIRE()->getData(),
'learnMore' => $this->gre->globalIndustrialRealEstateLearnMore()->getData()
]);
}
2024-05-15 11:50:32 +05:30
public function residential()
{
2024-03-28 14:52:40 +05:30
// dd($this->gre->openGRRE()->getData());
2024-05-15 11:50:32 +05:30
return view('Frontend.Pages.global-real-estate.residential', [
2024-03-28 14:52:40 +05:30
'openGRRE' => $this->gre->openGRRE()->getData(),
'fullyFundedGRRE' => $this->gre->fullyFundedGRRE()->getData(),
'resaleGRRE' => $this->gre->resaleGRRE()->getData(),
'learnMore' => $this->gre->globalResidentialRealEstateLearnMore()->getData()
]);
}
2024-05-15 11:50:32 +05:30
public function commercial()
{
2024-03-28 14:52:40 +05:30
// dd($this->gre->openGCRE()->getData());
2024-05-15 11:50:32 +05:30
return view('Frontend.Pages.global-real-estate.commercial', [
2024-03-28 14:52:40 +05:30
'openGCRE' => $this->gre->openGCRE()->getData(),
'fullyFundedGCRE' => $this->gre->fullyFundedGCRE()->getData(),
'resaleGCRE' => $this->gre->resaleGCRE()->getData(),
'learnMore' => $this->gre->globalCommercialRealEstateLearnMore()->getData()
]);
}
2024-05-15 11:50:32 +05:30
2024-03-28 14:52:40 +05:30
public function globalIndustrialRealEstateAllData($type = 'Open')
{
try {
2024-05-15 11:50:32 +05:30
return (new test(Product::has('realEstate')->with('realEstate.photo')->globalIndustrialRealEstate()->where('type', $type)->active()->get()))
2024-03-28 14:52:40 +05:30
->response()
->setStatusCode(200);
} catch (\Exception $e) {
return response()->json(['message' => $e->getMessage()], 400);
}
}
public function globalResidentialRealEstateAllData($type = 'Open')
{
try {
2024-05-15 11:50:32 +05:30
return (new test(Product::has('realEstate')->with('realEstate.photo')->globalResidentialRealEstate()->where('type', $type)->active()->get()))
2024-03-28 14:52:40 +05:30
->response()
->setStatusCode(200);
} catch (\Exception $e) {
return response()->json(['message' => $e->getMessage()], 400);
}
}
public function globalCommercialRealEstateAllData($type = 'Open')
{
try {
2024-05-15 11:50:32 +05:30
return (new test(Product::has('realEstate')->with('realEstate.photo')->globalCommercialRealEstate()->where('type', $type)->active()->get()))
2024-03-28 14:52:40 +05:30
->response()
->setStatusCode(200);
} catch (\Exception $e) {
return response()->json(['message' => $e->getMessage()], 400);
}
}
}