diff --git a/app/Http/Controllers/Frontend/DashboardController.php b/app/Http/Controllers/Frontend/DashboardController.php index 7c532cb..74c6eb1 100644 --- a/app/Http/Controllers/Frontend/DashboardController.php +++ b/app/Http/Controllers/Frontend/DashboardController.php @@ -47,14 +47,14 @@ class DashboardController extends Controller $freInvestmentListed = $this->freInvestmentListed()['data']; $opInvestmentListed = $this->opInvestmentListed()['data']; // - $marketPlaceAIFSellerData = $this->getMarketplaceAIFSellerData(); - $marketPlaceFRESellerData = $this->getMarketplaceFRESellerData(); + $marketPlaceAIFSellerData = $this->getMarketplaceAIFSellerData(1); + $marketPlaceFRESellerData = $this->getMarketplaceFRESellerData(1); $marketPlaceOPSellerData = $this->getMarketplaceOPSellerData(); $totalInvestmentTillDate = '₹ ' . $this->IND_money_format($currentInvestmentProduct['totalInvestmentInInt'] + $reedemedInvestmentProduct['totalInvestmentInInt']); return view('Frontend.Pages.profile.dashboard', compact('currentInvestmentProduct', 'reedemedInvestmentProduct', 'totalInvestmentTillDate', 'aifInvestmentWatchlist', 'freInvestmentWatchlist', 'opInvestmentWatchlist', 'aifSoldInvestmentWatchlist', 'freSoldInvestmentWatchlist', 'opSoldInvestmentWatchlist', 'user', 'aifInvestmentListed', 'freInvestmentListed', 'opInvestmentListed', 'marketPlaceAIFSellerData', 'marketPlaceFRESellerData', 'marketPlaceOPSellerData')); } - public function getMarketplaceAIFSellerData() + public function getMarketplaceAIFSellerData($api = null) { $id = auth()->guard('users')->user()->id ?? request()->user()->id; // $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_aif_sellers'])->get(); @@ -66,9 +66,16 @@ class DashboardController extends Controller $sellerData = MarketplaceSellerForm::with('aif')->where('users_id',$id)->get(); // dd($sellerData); // return $sellerData[0]->aif['name_of_the_aif_fund']; + // return $api; + if($api == null) + { + $data['data'] = $sellerData; + return $data; + } if(count($sellerData->toArray())) { $market_place_data = $sellerData[0]->aif->toArray(); + // dd($market_place_data); return $market_place_data; } return $sellerData; @@ -111,7 +118,7 @@ class DashboardController extends Controller return $data; } - public function getMarketplaceFRESellerData() + public function getMarketplaceFRESellerData($api = null) { $id = auth()->guard('users')->user()->id ?? request()->user()->id; // $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_fre_sellers'])->get(); @@ -121,6 +128,11 @@ class DashboardController extends Controller // return $market_place_data; $sellerData = MarketplaceSellerForm::with('fre')->where('users_id',$id)->get(); // dd(count($sellerData->toArray())); + if($api == null) + { + $data['data'] = $sellerData; + return $data; + } if(count($sellerData->toArray())) { $market_place_data = $sellerData[0]->fre->toArray(); diff --git a/app/Http/Resources/AngelFundResource.php b/app/Http/Resources/AngelFundResource.php index 6018b5c..f430aa6 100644 --- a/app/Http/Resources/AngelFundResource.php +++ b/app/Http/Resources/AngelFundResource.php @@ -28,8 +28,8 @@ class AngelFundResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id)->value('presentation'), - 'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'), + 'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null, 'fund_name' => $this->fund_name, 'slug' => $this->slug, 'registration_number' => $this->registration_number, diff --git a/app/Http/Resources/FractionalRealEstateResource.php b/app/Http/Resources/FractionalRealEstateResource.php index 248b9f4..33afc53 100644 --- a/app/Http/Resources/FractionalRealEstateResource.php +++ b/app/Http/Resources/FractionalRealEstateResource.php @@ -29,8 +29,8 @@ class FractionalRealEstateResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null, - 'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null, + 'presentation' => Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null, 'companies_id' => $this->companies_id, 'slug' => $this->slug, 'property_name_and_location' => $this->property_name_and_location, diff --git a/app/Http/Resources/FundForDistressedAssetResource.php b/app/Http/Resources/FundForDistressedAssetResource.php index c720063..ae6553a 100644 --- a/app/Http/Resources/FundForDistressedAssetResource.php +++ b/app/Http/Resources/FundForDistressedAssetResource.php @@ -28,8 +28,8 @@ class FundForDistressedAssetResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id)->value('presentation'), - 'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'), + 'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null, 'fund_name' => $this->fund_name, 'slug' => $this->slug, 'isin_code' => $this->isin_code, diff --git a/app/Http/Resources/GlobalBondResource.php b/app/Http/Resources/GlobalBondResource.php index e54039c..85f0c49 100644 --- a/app/Http/Resources/GlobalBondResource.php +++ b/app/Http/Resources/GlobalBondResource.php @@ -19,8 +19,8 @@ class GlobalBondResource extends JsonResource return [ 'id' => $this->id, 'products_id' => $this->products_id, - 'presentation' => Product::find($this->products_id)->value('presentation'), - 'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'), + 'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null, 'slug' => $this->slug, 'issuer' => $this->issuer, 'type' => $this->type, diff --git a/app/Http/Resources/GlobalEquityStockRealEstateResource.php b/app/Http/Resources/GlobalEquityStockRealEstateResource.php index 8823c74..ebfc5b8 100644 --- a/app/Http/Resources/GlobalEquityStockRealEstateResource.php +++ b/app/Http/Resources/GlobalEquityStockRealEstateResource.php @@ -18,8 +18,8 @@ class GlobalEquityStockRealEstateResource extends JsonResource return [ 'id' => $this->id, 'products_id' => $this->products_id, - 'presentation' => Product::find($this->products_id)->value('presentation'), - 'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'), + 'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null, 'name' => $this->name, 'type' => $this->type, 'slug' => $this->slug, diff --git a/app/Http/Resources/GlobalFundResource.php b/app/Http/Resources/GlobalFundResource.php index 529a295..87be1ad 100644 --- a/app/Http/Resources/GlobalFundResource.php +++ b/app/Http/Resources/GlobalFundResource.php @@ -29,8 +29,8 @@ class GlobalFundResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null, - 'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null, + 'presentation' => Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null, 'slug' => $this->slug, 'issuer' => $this->issuer, 'fund_name' => $this->fund_name, diff --git a/app/Http/Resources/HedgeFundResource.php b/app/Http/Resources/HedgeFundResource.php index 59b2d18..0078f29 100644 --- a/app/Http/Resources/HedgeFundResource.php +++ b/app/Http/Resources/HedgeFundResource.php @@ -29,8 +29,8 @@ class HedgeFundResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null, - 'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null, + 'presentation' => Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null, 'fund_name' => $this->fund_name, 'slug' => $this->slug, 'registration_number' => $this->registration_number, diff --git a/app/Http/Resources/InfrastructureFundResource.php b/app/Http/Resources/InfrastructureFundResource.php index eec791e..237bca4 100644 --- a/app/Http/Resources/InfrastructureFundResource.php +++ b/app/Http/Resources/InfrastructureFundResource.php @@ -28,8 +28,8 @@ class InfrastructureFundResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id) == null ? null : Product::find($this->products_id)->value('presentation'), - 'fact_sheet' => Product::find($this->products_id) == null ? null : Product::find($this->products_id)->value('fact_sheet'), + 'presentation' => Product::find($this->products_id) == null ? null : Product::where($this->products_id)->value('presentation'), + 'fact_sheet' => Product::find($this->products_id) == null ? null : Product::where($this->products_id)->value('fact_sheet'), 'fund_name' => $this->fund_name ?? '', 'slug' => $this->slug ?? '', 'isin_code' => $this->isin_code ?? '', diff --git a/app/Http/Resources/LongOnlyEquityResource.php b/app/Http/Resources/LongOnlyEquityResource.php index 3a42fe2..957361e 100644 --- a/app/Http/Resources/LongOnlyEquityResource.php +++ b/app/Http/Resources/LongOnlyEquityResource.php @@ -25,12 +25,14 @@ class LongOnlyEquityResource extends JsonResource } } + // $presentationFile = Product::where('id',$this->products_id)->value('presentation'); + // dd($presentationFile,$this->products_id); return [ 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null, - 'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null, + 'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null, 'fund_name' => $this->fund_name, 'slug' => $this->slug, 'registration_number' => $this->registration_number, diff --git a/app/Http/Resources/PrivateEquityFundResource.php b/app/Http/Resources/PrivateEquityFundResource.php index f122bfd..0d60c16 100644 --- a/app/Http/Resources/PrivateEquityFundResource.php +++ b/app/Http/Resources/PrivateEquityFundResource.php @@ -28,8 +28,8 @@ class PrivateEquityFundResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' =>Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null, - 'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null, + 'presentation' =>Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null, 'fund_name' => $this->fund_name, 'slug' => $this->slug, 'registration_number' => $this->registration_number, diff --git a/app/Http/Resources/PrivateInvestmentInPublicEquityFundResource.php b/app/Http/Resources/PrivateInvestmentInPublicEquityFundResource.php index afe8b6b..af0fd37 100644 --- a/app/Http/Resources/PrivateInvestmentInPublicEquityFundResource.php +++ b/app/Http/Resources/PrivateInvestmentInPublicEquityFundResource.php @@ -28,8 +28,8 @@ class PrivateInvestmentInPublicEquityFundResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null, - 'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null, + 'presentation' => Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null, 'fund_name' => $this->fund_name, 'slug' => $this->slug, 'registration_number' => $this->registration_number, diff --git a/app/Http/Resources/PrivateRealEstateFundResource.php b/app/Http/Resources/PrivateRealEstateFundResource.php index 708c897..bc5cbc5 100644 --- a/app/Http/Resources/PrivateRealEstateFundResource.php +++ b/app/Http/Resources/PrivateRealEstateFundResource.php @@ -29,8 +29,8 @@ class PrivateRealEstateFundResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id) == false ? null : Product::find($this->products_id)->value('presentation'), - 'fact_sheet' => Product::find($this->products_id) == false ? null : Product::find($this->products_id)->value('fact_sheet'), + 'presentation' => Product::find($this->products_id) == null ? null : Product::where($this->products_id)->value('presentation'), + 'fact_sheet' => Product::find($this->products_id) == null ? null : Product::where($this->products_id)->value('fact_sheet'), 'fund_name' => $this->fund_name, 'slug' => $this->slug, 'registration_number' => $this->registration_number, diff --git a/app/Http/Resources/RealEstateResource.php b/app/Http/Resources/RealEstateResource.php index 8083941..87b6272 100644 --- a/app/Http/Resources/RealEstateResource.php +++ b/app/Http/Resources/RealEstateResource.php @@ -19,8 +19,8 @@ class RealEstateResource extends JsonResource return [ 'id' => $this->id, 'products_id' => $this->products_id, - 'presentation' => Product::find($this->products_id)->value('presentation'), - 'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'), + 'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null, 'property_name' => $this->property_name, 'slug' => $this->slug, 'property_location' => $this->property_location, diff --git a/app/Http/Resources/VentureCapitalFundResource.php b/app/Http/Resources/VentureCapitalFundResource.php index 1b0460a..4f2e620 100644 --- a/app/Http/Resources/VentureCapitalFundResource.php +++ b/app/Http/Resources/VentureCapitalFundResource.php @@ -28,8 +28,8 @@ class VentureCapitalFundResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null, - 'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null, + 'presentation' => Product::find($this->products_id) ? Product::where($this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where($this->products_id)->value('fact_sheet') : null, 'fund_name' => $this->fund_name, 'slug' => $this->slug, 'registration_number' => $this->registration_number, diff --git a/app/Http/Resources/VentureDebtResource.php b/app/Http/Resources/VentureDebtResource.php index 57f90f9..af1f13c 100644 --- a/app/Http/Resources/VentureDebtResource.php +++ b/app/Http/Resources/VentureDebtResource.php @@ -30,8 +30,8 @@ class VentureDebtResource extends JsonResource 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, - 'presentation' => Product::find($this->products_id)->value('presentation'), - 'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'), + 'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null, + 'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null, 'company_name' => $this->company_name, 'slug' => $this->slug, 'sector' => $this->sector,