diff --git a/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php b/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php index 2d43a96..7f23db3 100644 --- a/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php +++ b/app/Http/Controllers/Admin/ManageFreeUInvestmentController.php @@ -8,6 +8,7 @@ use App\Imports\BondImport; use App\Imports\CleanAndGreenAssetImport; use App\Imports\FundImport; use App\Imports\StockFundsRealEstateExchangeImport; +use App\Models\VentureDebt; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Maatwebsite\Excel\Facades\Excel; @@ -76,6 +77,27 @@ class ManageFreeUInvestmentController extends Controller { // dd($request->all()); $product = Product::where('id', $request->id)->delete(); + // $FREProduct = FractionalRealEstate::where('products_id',$request->id)->first(); + if (FractionalRealEstate::where('products_id', $request->id)->exists()) { + FractionalRealEstate::where('products_id', $request->id)->delete(); + } elseif (AlternativeInvestmentFund::where('products_id', $request->id)->exists()) { + AlternativeInvestmentFund::where('products_id', $request->id)->delete(); + } elseif (RealEstate::where('products_id', $request->id)->exists()) { + RealEstate::where('products_id', $request->id)->delete(); + } elseif (Fund::where('products_id', $request->id)->exists()) { + Fund::where('products_id', $request->id)->delete(); + } elseif (IndianFinancialAssets::where('products_id', $request->id)->exists()) { + IndianFinancialAssets::where('products_id', $request->id)->delete(); + } elseif (StockFundsRealEstateExchange::where('products_id', $request->id)->exists()) { + StockFundsRealEstateExchange::where('products_id', $request->id)->delete(); + } elseif (VentureDebt::where('products_id', $request->id)->exists()) { + VentureDebt::where('products_id', $request->id)->delete(); + } elseif (VentureDebt::where('products_id', $request->id)->exists()) { + VentureDebt::where('products_id', $request->id)->delete(); + } elseif (InvoiceDiscounting::where('products_id', $request->id)->exists()) { + InvoiceDiscounting::where('products_id', $request->id)->delete(); + } + if ($product) { return response(['status' => 200, 'message' => 'Product deleted successfully']); } else { diff --git a/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php b/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php index 408d081..abfe30d 100644 --- a/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php +++ b/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php @@ -192,13 +192,14 @@ class FractionalRealEstateController extends Controller if ($request->hasFile('images')) { - // dd($request->hasFile('images')); + dd($request->hasFile('images')); // $edit_program_images = ProgramImage::where('programs_xid', $program_id)->delete(); foreach ($request->file('images') as $key => $file) { $filename = date('YmdHi') . '_' . $file->getClientOriginalName(); $file->move(public_path('assets/uploads/fractionalrealestate_images'), $filename); $images = 'assets/uploads/fractionalrealestate_images/' . $filename; + $fractionalRealEstate = new ProductImage(); $fractionalRealEstate->product_xid = $request->product_id; $fractionalRealEstate->images = $images; diff --git a/app/Http/Controllers/Frontend/FractionalRealEstateController.php b/app/Http/Controllers/Frontend/FractionalRealEstateController.php index ae27647..58aac2e 100644 --- a/app/Http/Controllers/Frontend/FractionalRealEstateController.php +++ b/app/Http/Controllers/Frontend/FractionalRealEstateController.php @@ -15,13 +15,13 @@ class FractionalRealEstateController extends Controller public function index() { $fractionalRealEstate = $this->fractData()->getData(); - $openFRE = Product::has('fractional_real_estate')->with('fractional_real_estate.companies','categorys')->open()->active()->latest()->get(); - $resaleFRE = Product::has('fractional_real_estate')->with('fractional_real_estate.companies','categorys')->resale()->active()->latest()->get(); - $fullyFundedFRE = Product::has('fractional_real_estate')->with('fractional_real_estate.companies','categorys')->fullyFunded()->active()->latest()->get(); + $openFRE = Product::has('fractional_real_estate')->with('fractional_real_estate.companies', 'categorys')->open()->active()->latest()->get(); + $resaleFRE = Product::has('fractional_real_estate')->with('fractional_real_estate.companies', 'categorys')->resale()->active()->latest()->get(); + $fullyFundedFRE = Product::has('fractional_real_estate')->with('fractional_real_estate.companies', 'categorys')->fullyFunded()->active()->latest()->get(); $learnMore = (new FractionalRealEstateFontendController)->fractionalRealEstateQuestionAndAnswer()->getData(); // $faqs = (new FractionalRealEstateFontendController)->fractionalRealEstateQuestionAndAnswerFaqs()->getData(); // dd($openFRE); - return view('Frontend.Pages.fractional-real-estate.index', compact('fractionalRealEstate','learnMore','openFRE', 'resaleFRE', 'fullyFundedFRE')); + return view('Frontend.Pages.fractional-real-estate.index', compact('fractionalRealEstate', 'learnMore', 'openFRE', 'resaleFRE', 'fullyFundedFRE')); } public function product($slug) @@ -32,27 +32,26 @@ class FractionalRealEstateController extends Controller ->where(['status' => true, 'categories_id' => 2]) ->where('slug', '!=', $slug) ->get(); - // dd($fractionalRealEstate); - - $productData = FractionalRealEstate::where('slug','=',$slug)->first(); - $productData = Product::with('product_images')->where('id','=',$productData->products_id)->first(); + // dd($fractionalRealEstate); + + $productData = FractionalRealEstate::where('slug', '=', $slug)->first(); + $productData = Product::with('product_images')->where('id', $productData->products_id)->first(); + // dd($productData); // $productData['presentation_file'] = $productData->getRawOriginal('presentation'); // $productData['fact_sheet_file'] = $productData->getRawOriginal('fact_sheet'); // dd($fractionalRealEstate); - return view('Frontend.Pages.fractional-real-estate.product', compact('fractionalRealEstate','otherFRE','productData')); + return view('Frontend.Pages.fractional-real-estate.product', compact('fractionalRealEstate', 'otherFRE', 'productData')); } - - public function downloadFilePersantation($filename){ + + public function downloadFilePersantation($filename) + { // dd($filename); - if(\File::exists('public/uploads/product/presentation/'.$filename)) - { + if (\File::exists('public/uploads/product/presentation/' . $filename)) { // dd('hello'); - return response()->download(public_path('/uploads/product/presentation/'.$filename)); - } - else if(\File::exists('public/uploads/product/fact_sheet/'.$filename)) - { - return response()->download(public_path('/uploads/product/fact_sheet/'.$filename)); - }else{ + return response()->download(public_path('/uploads/product/presentation/' . $filename)); + } else if (\File::exists('public/uploads/product/fact_sheet/' . $filename)) { + return response()->download(public_path('/uploads/product/fact_sheet/' . $filename)); + } else { return "file not found"; } dd('hello'); @@ -62,8 +61,7 @@ class FractionalRealEstateController extends Controller { try { $product = Product::has('fractional_real_estate')->with('fractional_real_estate.companies')->active()->get(); - foreach($product as $fre) - { + foreach ($product as $fre) { $fre->fractional_real_estate->property_img = $fre->fractional_real_estate->getRawOriginal('property_image'); } return (new test($product)) @@ -74,9 +72,10 @@ class FractionalRealEstateController extends Controller } } - public function fractionalRealEstateData($slug){ + public function fractionalRealEstateData($slug) + { try { - return (new FractionalRealEstateResource(FractionalRealEstate::where('slug',$slug)->first())) + return (new FractionalRealEstateResource(FractionalRealEstate::where('slug', $slug)->first())) ->response() ->setStatusCode(200); } catch (\Exception $e) { diff --git a/app/Models/AlternativeInvestmentFund.php b/app/Models/AlternativeInvestmentFund.php index 08b2435..605f32d 100644 --- a/app/Models/AlternativeInvestmentFund.php +++ b/app/Models/AlternativeInvestmentFund.php @@ -4,10 +4,11 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class AlternativeInvestmentFund extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $hidden = ['created_at','updated_at']; diff --git a/app/Models/FractionalRealEstate.php b/app/Models/FractionalRealEstate.php index f4bf617..6be0ded 100644 --- a/app/Models/FractionalRealEstate.php +++ b/app/Models/FractionalRealEstate.php @@ -4,10 +4,11 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class FractionalRealEstate extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $hidden = ['created_at','updated_at']; diff --git a/app/Models/Fund.php b/app/Models/Fund.php index d61ee77..e29e49f 100644 --- a/app/Models/Fund.php +++ b/app/Models/Fund.php @@ -4,10 +4,11 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class Fund extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $fillable = ['products_id','slug','issuer','fund_name','fund_type','about_issuer','fund_description','sharpe_ratio','annualized_volatility','max_dropdown','isin','inception_date','fund_aum','expense_ratio','nav_per_unit','minimum_investment','ytd','year1_return','year3_return']; diff --git a/app/Models/IndianFinancialAssets.php b/app/Models/IndianFinancialAssets.php index 50d5d1d..6eb4924 100644 --- a/app/Models/IndianFinancialAssets.php +++ b/app/Models/IndianFinancialAssets.php @@ -4,10 +4,11 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class IndianFinancialAssets extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $fillable = ['products_id','type','slug','product_name','investment_platform','counter_party','investment_date','amount_invested','total_gross_repaid_amount','tenure','principal_payment_frequency','interest_payment_frequency','next_repayment_due_date','maturity_date','next_repayment_amount','expected_irr']; } diff --git a/app/Models/InvoiceDiscounting.php b/app/Models/InvoiceDiscounting.php index 28a7c59..dd453ac 100644 --- a/app/Models/InvoiceDiscounting.php +++ b/app/Models/InvoiceDiscounting.php @@ -4,10 +4,11 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class InvoiceDiscounting extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $hidden = ['created_at','updated_at']; diff --git a/app/Models/RealEstate.php b/app/Models/RealEstate.php index 3a3687a..24a4448 100644 --- a/app/Models/RealEstate.php +++ b/app/Models/RealEstate.php @@ -4,10 +4,11 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class RealEstate extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $fillable = ['products_id','slug','property_name','property_location','project_type','current_status','price_per_sq_ft','booking_amount','price_range','total_price','transaction_type','project_code_or_rera_id','built_up_area','carpet_area','area_in_sq_ft','construction_status','launch_date','completed_in','total_units','unit_type','no_of_bedrooms','no_of_restrooms','no_of_floors','furnished_status','commencement_certificate','occupancy_certificate','total_towers','builder_details','landmarks','amenities','elevators','car_parking','electricity_status','fire_safety_measures','water_facility','price_negotiable','maintenance_fees','nearest_railway_metro_station','pre_leased','tenant_details','facilities_features','construction_age','remarks','location','country']; diff --git a/app/Models/StockFundsRealEstateExchange.php b/app/Models/StockFundsRealEstateExchange.php index 4a71e0d..4d2b3f3 100644 --- a/app/Models/StockFundsRealEstateExchange.php +++ b/app/Models/StockFundsRealEstateExchange.php @@ -4,10 +4,11 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class StockFundsRealEstateExchange extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $fillable = ['products_id','name','type','slug','ticker','exchange','about','industry','market_cap','pe_ratio','dividend_yield','beta','provider','category','expense_ratio','month1_return','month6_return','year1_return','year3_return']; } diff --git a/app/Models/VentureDebt.php b/app/Models/VentureDebt.php index d768308..cbb951f 100644 --- a/app/Models/VentureDebt.php +++ b/app/Models/VentureDebt.php @@ -4,10 +4,11 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class VentureDebt extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $hidden = ['created_at','updated_at']; diff --git a/app/helper.php b/app/helper.php index 8137569..d2d8b83 100644 --- a/app/helper.php +++ b/app/helper.php @@ -45,7 +45,7 @@ function imagePath($path = null) $finalPath = "https://staging.jerichoalternatives.in/"; } if (env('APP_ENV') == 'local') { - $finalPath = "http://localhost/my-freeu/"; + $finalPath = "http://localhost/jericho_28_march/"; } return $finalPath . $path; } diff --git a/public/assets/uploads/fractionalrealestate_images/202404101553_image.png b/public/assets/uploads/fractionalrealestate_images/202404101553_image.png new file mode 100644 index 0000000..0513644 Binary files /dev/null and b/public/assets/uploads/fractionalrealestate_images/202404101553_image.png differ diff --git a/resources/views/Frontend/Pages/index.blade.php b/resources/views/Frontend/Pages/index.blade.php index 76d8764..dc9e13b 100644 --- a/resources/views/Frontend/Pages/index.blade.php +++ b/resources/views/Frontend/Pages/index.blade.php @@ -400,7 +400,7 @@ @endif -

{{ $pick->product_name }}-{{ $pick->categories_id }}

+

{{ $pick->product_name }}

Category: {{ $pick->category_name }}