From 092cf779300b198f97facb79b10f0c8525ef99d2 Mon Sep 17 00:00:00 2001 From: Ritikeshyadav <126074361+Ritikeshyadav@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:53:20 +0530 Subject: [PATCH] fixed product update issue --- .../Controllers/Admin/ManageFreeUInvestmentController.php | 8 ++++---- .../FractionalRealEstateController.php | 4 ++-- .../VentureCapitalFundController.php | 4 ++-- .../Frontend/AlternativeInvestmentFundController.php | 2 ++ app/Http/Resources/VentureCapitalFundResource.php | 3 ++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php b/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php index 36375ff..965a02e 100644 --- a/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php +++ b/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php @@ -497,10 +497,10 @@ class ManageFreeUInvestmentController extends Controller ); } - $count = Fund::where('issuer', $request->issuer)->count(); + // $count = Fund::where('issuer', $request->issuer)->count(); $fund = Fund::where('id', $request->fund_id)->update([ 'issuer' => $request->issuer, - 'slug' => Str::slug($request->issuer).'-'.++$count, + // 'slug' => Str::slug($request->issuer).'-'.++$count, 'fund_name' => $request->fund_name, 'geographic_focus' => $request->geographic_focus, 'fund_type' => $request->fund_type, @@ -840,10 +840,10 @@ class ManageFreeUInvestmentController extends Controller ); } - $count = RealEstate::where('property_name',$request->property_name)->count(); + // $count = RealEstate::where('property_name',$request->property_name)->count(); $realEstate = RealEstate::where('id', $request->realEstates)->update([ 'property_name' => $request->property_name, - 'slug' => Str::slug($request->property_name).'-'.++$count, + // 'slug' => Str::slug($request->property_name).'-'.++$count, 'platform_partner' => $request->companies_id, 'geographic_focus' => $request->geographic_focus, 'price_per_sq_ft' => $request->price_per_sq_ft, diff --git a/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php b/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php index 6c56ad6..60178e9 100644 --- a/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php +++ b/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php @@ -128,10 +128,10 @@ class FractionalRealEstateController extends Controller ); } - $count = FractionalRealEstate::where('property_name_and_location',$request->property_name_and_location)->count(); + // $count = FractionalRealEstate::where('property_name_and_location',$request->property_name_and_location)->count(); $fractionalRealEstate = FractionalRealEstate::where('id', $id)->update([ - 'slug' => Str::slug($request->property_name_and_location).'-'.++$count, + // 'slug' => Str::slug($request->property_name_and_location).'-'.++$count, 'companies_id' => $request->companies_id, 'geographic_focus' => $request->geographic_focus, 'property_name_and_location' => $request->property_name_and_location, diff --git a/app/Http/Controllers/Admin/ManageFreeUInvestments/VentureCapitalFundController.php b/app/Http/Controllers/Admin/ManageFreeUInvestments/VentureCapitalFundController.php index b879ac3..47a4c87 100644 --- a/app/Http/Controllers/Admin/ManageFreeUInvestments/VentureCapitalFundController.php +++ b/app/Http/Controllers/Admin/ManageFreeUInvestments/VentureCapitalFundController.php @@ -131,11 +131,11 @@ class VentureCapitalFundController extends Controller } // dd($request->all()); - $count = AlternativeInvestmentFund::where('fund_name',$request->fund_name)->count(); + // $count = AlternativeInvestmentFund::where('fund_name',$request->fund_name)->count(); $alternativeInvestmentFund = AlternativeInvestmentFund::where('id', $request->id)->update([ - 'slug' => Str::slug($request->fund_name).'-'.++$count, + // 'slug' => Str::slug($request->fund_name).'-'.$count+1, 'fund_name' => $request->fund_name, 'geographic_focus' => $request->geographic_focus, 'companies_id' => $request->companies_id, diff --git a/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php b/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php index 8c6fe74..8d84e63 100644 --- a/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php +++ b/app/Http/Controllers/Frontend/AlternativeInvestmentFundController.php @@ -156,6 +156,7 @@ class AlternativeInvestmentFundController extends Controller public function ventureCapitalFundProduct($slug) { + // dd($slug); $ventureCapitalFund = $this->ventureCapitalData($slug)->getData()->data; // dd($ventureCapitalFund); $otherVCP = AlternativeInvestmentFund::query() @@ -309,6 +310,7 @@ class AlternativeInvestmentFundController extends Controller public function ventureCapitalData($slug) { + // dd(AlternativeInvestmentFund::all()->toArray()); // dd(AlternativeInvestmentFund::where('slug', $slug)->first()); try { return (new VentureCapitalFundResource(AlternativeInvestmentFund::where('slug', $slug)->first())) diff --git a/app/Http/Resources/VentureCapitalFundResource.php b/app/Http/Resources/VentureCapitalFundResource.php index 5e0be34..37e4869 100644 --- a/app/Http/Resources/VentureCapitalFundResource.php +++ b/app/Http/Resources/VentureCapitalFundResource.php @@ -15,6 +15,7 @@ class VentureCapitalFundResource extends JsonResource */ public function toArray($request) { + // dd($this); $images = ProductImage::where('product_xid', $this->products_id)->get(); $imagePaths = []; if (!empty($images)) { @@ -24,7 +25,7 @@ class VentureCapitalFundResource extends JsonResource } } - // dd($this); + // dd($this); return [ 'id' => $this->id, 'products_id' => $this->products_id,