added softdelete to all product models and delete product function changed
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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'];
|
||||
|
||||
|
||||
@@ -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'];
|
||||
|
||||
|
||||
@@ -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'];
|
||||
|
||||
|
||||
@@ -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'];
|
||||
}
|
||||
|
||||
@@ -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'];
|
||||
|
||||
|
||||
@@ -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'];
|
||||
|
||||
|
||||
@@ -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'];
|
||||
}
|
||||
|
||||
@@ -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'];
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -400,7 +400,7 @@
|
||||
@endif
|
||||
<img src="{{ asset(getCategoryIcons($pick->categories_id)) }}">
|
||||
|
||||
<p>{{ $pick->product_name }}-{{ $pick->categories_id }}</p>
|
||||
<p>{{ $pick->product_name }}</p>
|
||||
</div>
|
||||
<div class="middle-sec p-0">
|
||||
<p class="cate">Category: {{ $pick->category_name }}</p>
|
||||
|
||||
Reference in New Issue
Block a user