From 87cb07b466f5d5af4682a86b01e1f6feb30e5a1a Mon Sep 17 00:00:00 2001 From: Shailesh-1981 <86923815+Shailesh-1981@users.noreply.github.com> Date: Tue, 11 Jun 2024 12:22:49 +0530 Subject: [PATCH] image show and edit --- .../Admin/ManageFreeUInvestmentController.php | 18 +++++++--- .../Frontend/IndianRealAssetController.php | 2 +- app/Models/RealEstate.php | 6 ++++ app/helper.php | 2 +- ...2_add_platform_partner_to_real_estates.php | 36 +++++++++++++++++++ .../edit-product/funds.blade.php | 28 +++++++++++++++ .../edit-product/real-estate.blade.php | 28 +++++++++++++++ ...-residential-real-estate-product.blade.php | 6 +++- 8 files changed, 118 insertions(+), 8 deletions(-) create mode 100644 database/migrations/2024_06_10_192122_add_platform_partner_to_real_estates.php diff --git a/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php b/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php index 330277a..2bd9ce9 100644 --- a/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php +++ b/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php @@ -41,6 +41,7 @@ use Illuminate\Support\Str; use App\Models\ProductPhotoDocuments; use Illuminate\Support\Facades\Validator; use File; +use App\Models\Company; class ManageFreeUInvestmentController extends Controller { @@ -454,11 +455,12 @@ class ManageFreeUInvestmentController extends Controller public function editFundProduct($id) { + $companies = Company::active()->pluck('company_name', 'id'); // $categories = Category::all(); // $products = Product::with('category', 'fractional_real_estate.companies')->fractionalrealestate()->find($id); $fund = Product::with('category', 'funds.returns', 'product_images')->funds()->find($id); // dd($fund); - return view('Admin.Pages.manage_freeu_investment.edit-product.funds', compact('fund')); + return view('Admin.Pages.manage_freeu_investment.edit-product.funds', compact('fund','companies')); } public function updateFundProduct(Request $request) @@ -502,6 +504,7 @@ class ManageFreeUInvestmentController extends Controller 'fund_name' => $request->fund_name, 'geographic_focus' => $request->geographic_focus, 'fund_type' => $request->fund_type, + 'platform_partner' =>$request->companies_id, 'about_issuer' => $request->about_issuer, 'fund_description' => $request->description, 'sharpe_ratio' => $request->sharpe_ratio, @@ -773,6 +776,8 @@ class ManageFreeUInvestmentController extends Controller return view('Admin.Pages.manage_freeu_investment.upload-product.real-estate', compact('text', 'category_id', 'excelName')); } + + public function uploadRealEstateFile(Request $request) { request()->validate([ @@ -793,9 +798,12 @@ class ManageFreeUInvestmentController extends Controller public function editRealEstateProduct($id) { + $companies = Company::active()->pluck('company_name', 'id'); + // dd($companies); $categories = Category::all(); - $products = Product::with('category', 'realEstates', 'product_images')->realestates()->find($id); - return view('Admin.Pages.manage_freeu_investment.edit-product.real-estate', compact('products', 'categories')); + $products = Product::with('category','realEstates', 'product_images')->realestates()->find($id); + // dd($products); + return view('Admin.Pages.manage_freeu_investment.edit-product.real-estate', compact('products', 'categories','companies')); } public function updateRealEstateProduct(Request $request) @@ -835,7 +843,7 @@ class ManageFreeUInvestmentController extends Controller $realEstate = RealEstate::where('id', $request->realEstates)->update([ 'property_name' => $request->property_name, 'slug' => $count < 2 ? Str::slug($request->property_name) : Str::slug($request->property_name).'-'.$count+1, - // 'companies_id' => $request->companies_id, + 'platform_partner' => $request->companies_id, 'geographic_focus' => $request->geographic_focus, 'price_per_sq_ft' => $request->price_per_sq_ft, 'property_location' => $request->property_location, @@ -1476,7 +1484,7 @@ class ManageFreeUInvestmentController extends Controller public function updateAIFProduct(Request $request) { - dd($request->all()); + // dd($request->all()); $request->validate([ 'fund_name' => 'required' ]); diff --git a/app/Http/Controllers/Frontend/IndianRealAssetController.php b/app/Http/Controllers/Frontend/IndianRealAssetController.php index 1b5d10c..fab305d 100644 --- a/app/Http/Controllers/Frontend/IndianRealAssetController.php +++ b/app/Http/Controllers/Frontend/IndianRealAssetController.php @@ -32,7 +32,7 @@ class IndianRealAssetController extends Controller public function residential() { $realEstate = $this->indianResidentialRealEstateAllData()->getData(); - $openIRRE = Product::has('realEstate')->with('realEstate','categorys')->indianResidentialRealEstate()->open()->active()->get(); + $openIRRE = Product::has('realEstate')->with('realEstate.companies','categorys')->indianResidentialRealEstate()->open()->active()->get(); $resaleIRRE = Product::has('realEstate')->with('realEstate','categorys')->indianResidentialRealEstate()->resale()->active()->get(); $fullyFundedIRRE = Product::has('realEstate')->with('realEstate','categorys')->indianResidentialRealEstate()->fullyFunded()->active()->get(); $learnMore = (new FractionalRealEstateFrontendController)->indianResidentialRealEstateQuestionAndAnswer()->getData(); diff --git a/app/Models/RealEstate.php b/app/Models/RealEstate.php index 5dbcb87..db82f80 100644 --- a/app/Models/RealEstate.php +++ b/app/Models/RealEstate.php @@ -23,4 +23,10 @@ class RealEstate extends Model public function realEstateDocuments(){ return $this->hasMany(ProductPhotoDocuments::class,'real_estates_id')->where('type',1); } + + public function companies(){ + return $this->belongsTo(Company::class,'platform_partner'); + } + + } diff --git a/app/helper.php b/app/helper.php index 4d0fd11..8ff61fd 100644 --- a/app/helper.php +++ b/app/helper.php @@ -70,7 +70,7 @@ function imagePath($path = null) $finalPath = "https://staging.jerichoalternatives.in/"; } if (env('APP_ENV') == 'local') { - $finalPath = "http://localhost/my-freeu/"; + $finalPath = "http://localhost/new_freeu/my-freeu/"; } return $finalPath . $path; } diff --git a/database/migrations/2024_06_10_192122_add_platform_partner_to_real_estates.php b/database/migrations/2024_06_10_192122_add_platform_partner_to_real_estates.php new file mode 100644 index 0000000..bb9c40e --- /dev/null +++ b/database/migrations/2024_06_10_192122_add_platform_partner_to_real_estates.php @@ -0,0 +1,36 @@ +unsignedBigInteger('platform_partner')->after('products_id'); + $table->foreign('platform_partner')->references('id')->on('companies')->onDelete('cascade'); + + + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('real_estates', function (Blueprint $table) { + // + }); + } +} diff --git a/resources/views/Admin/Pages/manage_freeu_investment/edit-product/funds.blade.php b/resources/views/Admin/Pages/manage_freeu_investment/edit-product/funds.blade.php index 7437194..096ccf0 100644 --- a/resources/views/Admin/Pages/manage_freeu_investment/edit-product/funds.blade.php +++ b/resources/views/Admin/Pages/manage_freeu_investment/edit-product/funds.blade.php @@ -166,6 +166,34 @@ --}} + +
+ + +
+ + + +
+ +
diff --git a/resources/views/Admin/Pages/manage_freeu_investment/edit-product/real-estate.blade.php b/resources/views/Admin/Pages/manage_freeu_investment/edit-product/real-estate.blade.php index 497c029..150fcd2 100644 --- a/resources/views/Admin/Pages/manage_freeu_investment/edit-product/real-estate.blade.php +++ b/resources/views/Admin/Pages/manage_freeu_investment/edit-product/real-estate.blade.php @@ -166,6 +166,34 @@
--}} +
+ + +
+ + + +
+ +
+
diff --git a/resources/views/components/indian-residential-real-estate-product.blade.php b/resources/views/components/indian-residential-real-estate-product.blade.php index a505161..f46a226 100644 --- a/resources/views/components/indian-residential-real-estate-product.blade.php +++ b/resources/views/components/indian-residential-real-estate-product.blade.php @@ -3,11 +3,15 @@

{{$type}}

@if(count($irreAllData))
+ {{-- @dd($irreAllData[1]->realEstate->companies->company_logo); --}} @foreach($irreAllData as $ffdaData)