Files
freeu-project/app/Http/Controllers/Admin/ManageFreeUInvestments/FractionalRealEstateController.php
2024-05-03 13:54:10 +05:30

752 lines
26 KiB
PHP

<?php
namespace App\Http\Controllers\Admin\ManageFreeUInvestments;
use App\Http\Controllers\Controller;
use App\Models\Admin\FAQ;
use Illuminate\Http\Request;
use App\Models\Category;
use App\Models\Product;
use Maatwebsite\Excel\Facades\Excel;
use App\Models\FractionalRealEstate;
use App\Imports\FractionalRealEstateImport;
use Illuminate\Support\Str;
use App\Models\Company;
use App\Models\ProductImage;
use App\Models\Admin\Tag;
use Illuminate\Support\Facades\Validator;
class FractionalRealEstateController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$category = Category::find(Category::FractionalRealEstateId);
$text = $category->category_name;
$category_id = $category->id;
$excelFileName = 'FractionalRealEstateTemplate.xlsx';
return view('Admin.Pages.manage_freeu_investment.upload-product.fractional-real-estate', compact('text', 'category_id', 'excelFileName'));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
request()->validate([
'productFile' => 'required|mimes:xlx,xls,xlsx|max:2048'
]);
$category_type = $request->category_id;
$category = Category::find($request->category_id);
Excel::import(new FractionalRealEstateImport($category_type), $request->file('productFile'));
// return back()->with('success', 'Product Imported Successfully.');
return redirect()->route('manage.products')->with('success', "$category->category_name Imported Successfully.");
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$fractionalRealEstate = Product::with('category', 'fractional_real_estate','product_images')->fractionalrealestate()->findorFail($id);
// dd($fractionalRealEstate);
return view('Admin.Pages.manage_freeu_investment.view-product.fractional-real-estate', compact('fractionalRealEstate'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$companies = Company::active()->pluck('company_name', 'id');
$fractionalRealEstate = Product::with('category', 'fractional_real_estate','product_images')->fractionalrealestate()->find($id);
// dd($fractionalRealEstate);
return view('Admin.Pages.manage_freeu_investment.edit-product.fractional-real-estate', compact('fractionalRealEstate', 'id', 'companies'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
// dd($request->all());
$validate = Validator::make($request->all(), [
'property_name_and_location' => 'required',
'presentation' => "|mimes:pdf,zip,jpeg,jpg,png",
'fact_sheet' => "|mimes:pdf,zip,jpeg,jpg,png",
'type' => 'required',
'geographic_focus' => 'required',
], [
'required' => "This :attribute field is required",
'mimes' => "This :attribute field extension must be pdf,zip,jpeg,jpg,png"
]);
$validationMessage = validationErrorMessage($validate);
if ($validationMessage) {
return response()->json(
[
'status' => 400,
'message' => $validationMessage
]
);
}
$count = FractionalRealEstate::where('property_name_and_location',$request->property_name_and_location)->count();
$fractionalRealEstate = FractionalRealEstate::where('id', $id)->update([
'slug' => $count < 2 ? Str::slug($request->property_name_and_location) : Str::slug($request->property_name_and_location).'-'.$count+1,
'companies_id' => $request->companies_id,
'geographic_focus' => $request->geographic_focus,
'property_name_and_location' => $request->property_name_and_location,
'property_description' => $request->property_description,
'property_grade' => $request->property_grade,
'asset_type' => $request->asset_type,
'tenant' => $request->tenant,
'deal_size_in_crore' => $request->deal_size_in_crore,
'coupon_rate_on_ccd' => $request->coupon_rate_on_ccd,
'rental_escalation' => $request->rental_escalation,
'capital_appreciation' => $request->capital_appreciation,
'expected_irr' => $request->expected_irr,
'cagr' => $request->cagr,
'minimum_investment' => $request->minimum_investment,
'minimum_investment_lockin' => $request->minimum_investment_lockin,
'tenant_lease_term' => $request->tenant_lease_term,
'tenant_lock_in' => $request->tenant_lock_in,
'tenant_security_deposit' => $request->tenant_security_deposit,
'annual_management_fee' => $request->annual_management_fee,
'performance_fees' => $request->performance_fees,
'hurdle_rate' => $request->hurdle_rate,
]);
$fre = FractionalRealEstate::find($id);
if ($request->has('property_image')) {
if (\File::exists(public_path('/uploads/fractional_real_estate/property_image/' . $fre->property_image . ''))) {
\File::delete(public_path('/uploads/fractional_real_estate/property_image/' . $fre->property_image . ''));
}
$frePropertyImage = time() . '.' . $request->property_image->extension();
$request->property_image->move(public_path('/uploads/fractional_real_estate/property_image'), $frePropertyImage);
$updatePropertyImage = FractionalRealEstate::where('id', $id)->update([
'property_image' => $frePropertyImage,
]);
}
$product = Product::where('id', $request->product_id)->first();
// dd($product);
if ($request->has('presentation')) {
if (\File::exists(public_path('/uploads/product/presentation/' . $product->presentation))) {
\File::delete(public_path('/uploads/product/presentation/' . $product->presentation));
}
$productpresentation = time() . '_presentation' . '.' . $request->presentation->extension();
$request->presentation->move(public_path('/uploads/product/presentation'), $productpresentation);
$updatepresentation = Product::where('id', $request->product_id)->update([
'presentation' => $productpresentation,
]);
}
if ($request->has('fact_sheet')) {
if (\File::exists(public_path('/uploads/product/fact_sheet/' . $product->fact_sheet))) {
\File::delete(public_path('/uploads/product/fact_sheet' . $product->fact_sheet));
}
$productfactsheet = time() . '_factsheet' . '.' . $request->fact_sheet->extension();
$request->fact_sheet->move(public_path('uploads/product/fact_sheet'), $productfactsheet);
$updatefactsheet = Product::where('id', $request->product_id)->update([
'fact_sheet' => $productfactsheet,
]);
}
if ($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;
$fractionalRealEstate->save();
}
}
$type = Product::where('id', $fre->products_id)->update(['type' => $request->type]);
return response()->json(['status' => 200, 'message' => 'Fractional Real Estate Details Updated Successfully']);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
public function delete_fractional_image(Request $request){
$image = ProductImage::find($request->image_id);
$previous_image = public_path($image->images);
File::delete($previous_image);
$image->id = $request->image_id;
$image->delete();
return response()->json(['success' => true, 'status' => 200]);
// dd("requ",$request->all());
}
// Global private credit fund
public function globalPrivateCreditFundQuestionAndAnswer()
{
$fractionalRealEState = FAQ::where('tag_id', Tag::GlobalPrivateCreditFundId)->active()->where('faq_type', '0')->get();
return $this->returnData($fractionalRealEState);
}
// private credit fund
public function privateCreditFundQuestionAndAnswer()
{
$fractionalRealEState = FAQ::where('tag_id', Tag::PrivateCreditFundId)->active()->where('faq_type', '0')->get();
return $this->returnData($fractionalRealEState);
}
// long only equity fund
public function longOnlyEquityFundQuestionAndAnswer()
{
$fractionalRealEState = FAQ::where('tag_id', Tag::LongOnlyEquityFundId)->active()->where('faq_type', '0')->get();
return $this->returnData($fractionalRealEState);
}
// fractional real estate api
public function fractionalRealEstateQuestionAndAnswer()
{
$fractionalRealEState = FAQ::where('tag_id', Tag::FractionalRealEstateId)->active()->where('faq_type', '0')->get();
return $this->returnData($fractionalRealEState);
}
// faqs
public function fractionalRealEstateQuestionAndAnswerFaqs()
{
$fractionalRealEStateFaqs = FAQ::where(['tag_id' => Tag::FractionalRealEstateId, 'faq_type' => '1'])->get();
return $this->returnData($fractionalRealEStateFaqs);
}
public function peerToPeerLendingQuestionAndAnswer()
{
$peerToPerrLeanding = FAQ::where('tag_id', Tag::PeertoPeerLendingId)->active()->where('faq_type', '0')->get();
return $this->returnData($peerToPerrLeanding);
}
// faqs
public function peerToPeerLendingQuestionAndAnswerFaqs()
{
$peerToPerrLeandingFaqs = FAQ::where(['tag_id' => Tag::PeertoPeerLendingId, 'faq_type' => '1'])->get();
return $this->returnData($peerToPerrLeandingFaqs);
}
public function invoiceDiscountingQuestionAndAnswer()
{
$invoiceDiscointing = FAQ::where('tag_id', Tag::InvoiceDiscountingId)->active()->where('faq_type', '0')->get();
return $this->returnData($invoiceDiscointing);
}
// faqs
public function invoiceDiscountingQuestionAndAnswerFaqs()
{
$invoiceDiscointingFaqs = FAQ::where(['tag_id' => Tag::InvoiceDiscountingId, 'faq_type' => '1'])->get();
return $this->returnData($invoiceDiscointingFaqs);
}
public function revenueBasedFinancingQuestionAndAnswer()
{
$revenueBasedFinancing = FAQ::where('tag_id', Tag::RevenueBasedFinancingId)->active()->where('faq_type', '0')->get();
return $this->returnData($revenueBasedFinancing);
}
public function globalPCFQuestionAndAnswer()
{
$globalPrivateCreditFund = FAQ::where('tag_id', Tag::GlobalPrivateCreditFundId)->active()->where('faq_type', '0')->get();
return $this->returnData($globalPrivateCreditFund);
}
// faqs
public function revenueBasedFinancingQuestionAndAnswerFaqs()
{
$revenueBasedFinancingFaqs = FAQ::where(['tag_id' => Tag::RevenueBasedFinancingId, 'faq_type' => '1'])->get();
return $this->returnData($revenueBasedFinancingFaqs);
}
public function ventureDebtQuestionAndAnswer()
{
$ventureDebt = FAQ::where('tag_id', Tag::VentureDebtId)->active()->get();
return $this->returnData($ventureDebt);
}
// faqs
public function ventureDebtQuestionAndAnswerFaqs()
{
$ventureDebtFaqs = FAQ::where(['tag_id' => Tag::VentureDebtId, 'faq_type' => '1'])->get();
return $this->returnData($ventureDebtFaqs);
}
public function securitizedDebtInstrumentQuestionAndAnswer()
{
$securitizedDebtInstrument = FAQ::where('tag_id', Tag::SecuritizedDebtInstrumentId)->active()->get();
return $this->returnData($securitizedDebtInstrument);
}
// faqs
public function securitizedDebtInstrumentQuestionAndAnswerFaqs()
{
$securitizedDebtInstrumentFaqs = FAQ::where(['tag_id' => Tag::SecuritizedDebtInstrumentId, 'faq_type' => '1'])->get();
return $this->returnData($securitizedDebtInstrumentFaqs);
}
public function highYieldFinanceQuestionAndAnswer()
{
$highYieldFinance = FAQ::where('tag_id', Tag::HighYieldFinanceId)->active()->get();
return $this->returnData($highYieldFinance);
}
// faqs
public function highYieldFinanceQuestionAndAnswerFaqs()
{
$highYieldFinanceFaqs = FAQ::where(['tag_id' => Tag::HighYieldFinanceId, 'faq_type' => '1'])->get();
return $this->returnData($highYieldFinanceFaqs);
}
public function alternativeInvestmentFundQuestionAndAnswer()
{
$alternativeInvestment = FAQ::where('tag_id', Tag::AlternativeInvestmentFundId)->active()->get();
return $this->returnData($alternativeInvestment);
}
public function internationalBondsQuestionAndAnswer()
{
$internationalBonds = FAQ::where('tag_id', Tag::InternationalBondsId)->active()->where('faq_type', '0')->get();
return $this->returnData($internationalBonds);
}
// faqs
public function internationalBondsQuestionAndAnswerFaqs()
{
$internationalBondsFaqs = FAQ::where(['tag_id' => Tag::InternationalBondsId, 'faq_type' => '1'])->get();
return $this->returnData($internationalBondsFaqs);
}
public function mutualFundsQuestionAndAnswer()
{
$mutualFunds = FAQ::where('tag_id', Tag::MutualFundsId)->active()->get();
return $this->returnData($mutualFunds);
}
// mutual fund faqs
public function mutualFundsQuestionAndAnswerFaqs()
{
$mutualFundsFaqs = FAQ::where(['tag_id' => Tag::MutualFundsId, 'faq_type' => '1'])->get();
return $this->returnData($mutualFundsFaqs);
}
public function equitiesQuestionAndAnswer()
{
$equitiesQuestion = FAQ::where('tag_id', Tag::EquitiesId)->where('faq_type', '0')->active()->get();
return $this->returnData($equitiesQuestion);
}
// faqs
public function equitiesQuestionAndAnswerFaqs()
{
$equitiesQuestionFaqs = FAQ::where(['tag_id' => Tag::EquitiesId, 'faq_type' => '1'])->get();
return $this->returnData($equitiesQuestionFaqs);
}
public function exchangeTradedFundsQuestionAndAnswer()
{
$exchangeTradedFunds = FAQ::where('tag_id', Tag::ETFId)->active()->where('faq_type', '0')->get();
return $this->returnData($exchangeTradedFunds);
}
// faqs
public function exchangeTradedFundsQuestionAndAnswerFaqs()
{
$exchangeTradedFundsFaqs = FAQ::where(['tag_id' => Tag::ETFId, 'faq_type' => '1'])->get();
return $this->returnData($exchangeTradedFundsFaqs);
}
public function ventureCapitalFundQuestionAndAnswer()
{
$ventureCapitalFund = FAQ::where('tag_id', Tag::VentureCapitalFundId)->active()->get();
return $this->returnData($ventureCapitalFund);
}
public function privateEquityFundQuestionAndAnswer()
{
$privateEquity = FAQ::where('tag_id', Tag::PrivateEquityFundId)->active()->get();
return $this->returnData($privateEquity);
}
public function hedgeFundQuestionAndAnswer()
{
$hedgeFund = FAQ::where('tag_id', Tag::HedgeFundId)->active()->get();
return $this->returnData($hedgeFund);
}
public function reitQuestionAndAnswer()
{
$reit = FAQ::where('tag_id', Tag::REITId)->active()->where('faq_type', '0')->get();
return $this->returnData($reit);
}
// faqs
public function reitQuestionAndAnswerFaqs()
{
$reitFaqs = FAQ::where(['tag_id' => Tag::REITId, 'faq_type' => '1'])->get();
return $this->returnData($reitFaqs);
}
public function leaseBasedFinancingQuestionAndAnswer()
{
$leaseBasedFinancing = FAQ::where('tag_id', Tag::LeaseBasedFinancingId)->active()->where('faq_type', '0')->get();
return $this->returnData($leaseBasedFinancing);
}
// faq
public function leaseBasedFinancingQuestionAndAnswerFaqs()
{
$leaseBasedFinancingFaqs = FAQ::where(['tag_id' => Tag::LeaseBasedFinancingId, 'faq_type' => '1'])->get();
return $this->returnData($leaseBasedFinancingFaqs);
}
public function cleanAndGreenAssetsQuestionAndAnswer()
{
$cleanAndGreenAssets = FAQ::where('tag_id', Tag::CleanandGreenAssetsId)->active()->where('faq_type', '0')->get();
return $this->returnData($cleanAndGreenAssets);
}
// faq
public function cleanAndGreenAssetsQuestionAndAnswerFaqs()
{
$cleanAndGreenAssetsFaqs = FAQ::where(['tag_id' => Tag::CleanandGreenAssetsId, 'faq_type' => '1'])->get();
return $this->returnData($cleanAndGreenAssetsFaqs);
}
public function loefQuestionAndAnswer()
{
$loef = FAQ::where('tag_id', Tag::LongOnlyEquityFundId)->active()->get();
return $this->returnData($loef);
}
// faq
public function loefQuestionAndAnswerFaqs()
{
$loef = FAQ::where(['tag_id' => Tag::LongOnlyEquityFundId, 'faq_type' => '1'])->get();
return $this->returnData($loef);
}
public function pcfQuestionAndAnswer()
{
$pcf = FAQ::where('tag_id', Tag::PrivateCreditFundId)->active()->get();
return $this->returnData($pcf);
}
// faq
public function pcfQuestionAndAnswerFaqs()
{
$pcf = FAQ::where(['tag_id' => Tag::PrivateCreditFundId, 'faq_type' => '1'])->get();
return $this->returnData($pcf);
}
public function aifQuestionAndAnswer()
{
$aif = FAQ::where('tag_id', Tag::AlternativeInvestmentFundId)->active()->get();
return $this->returnData($aif);
}
// faqs
public function aifQuestionAndAnswerFaqs()
{
$aifFaqs = FAQ::where(['tag_id' => Tag::AlternativeInvestmentFundId, 'faq_type' => '1'])->get();
return $this->returnData($aifFaqs);
}
public function aifIQuestionAndAnswer()
{
$aifI = FAQ::where('tag_id', Tag::AIFIId)->active()->where('faq_type', '0')->get();
return $this->returnData($aifI);
}
// faqs
public function aifIQuestionAndAnswerFaqs()
{
$aifIFaqs = FAQ::where(['tag_id' => Tag::AIFIId, 'faq_type' => '1'])->get();
return $this->returnData($aifIFaqs);
}
public function aifIIQuestionAndAnswer()
{
$aifII = FAQ::where('tag_id', Tag::AIFIIId)->active()->where('faq_type', '0')->get();
return $this->returnData($aifII);
}
// faqs
public function aifIIQuestionAndAnswerFaqs()
{
$aifIIFaqs = FAQ::where(['tag_id' => Tag::AIFIIId, 'faq_type' => '1'])->get();
return $this->returnData($aifIIFaqs);
}
public function aifIIIQuestionAndAnswer()
{
$aifIII = FAQ::where('tag_id', Tag::AIFIIIId)->active()->where('faq_type', '0')->get();
return $this->returnData($aifIII);
}
// faqs
public function aifIIIQuestionAndAnswerFaqs()
{
$aifIIIFaqs = FAQ::where(['tag_id' => Tag::AIFIIIId, 'faq_type' => '1'])->get();
return $this->returnData($aifIIIFaqs);
}
public function infrastructureFundQuestionAndAnswer()
{
$infrastructure = FAQ::where('tag_id', Tag::InfrastructureFundId)->active()->get();
return $this->returnData($infrastructure);
}
public function angelFundQuestionAndAnswer()
{
$angleFund = FAQ::where('tag_id', Tag::AngelFundId)->active()->get();
return $this->returnData($angleFund);
}
public function debtFundQuestionAndAnswer()
{
$debtFund = FAQ::where('tag_id', Tag::DebtFundId)->active()->get();
return $this->returnData($debtFund);
}
public function fundForDistressedAssetQuestionAndAnswer()
{
$fundForDistressedAsset = FAQ::where('tag_id', Tag::FundForDistressedAssetId)->active()->get();
return $this->returnData($fundForDistressedAsset);
}
public function privateRealEstateFundQuestionAndAnswer()
{
$privateRealEstateFund = FAQ::where('tag_id', Tag::PrivateRealEstateFundId)->active()->get();
return $this->returnData($privateRealEstateFund);
}
public function privateInvestmentInPublicEquityFundQuestionAndAnswer()
{
$privateInvestmentInPublicEquityFund = FAQ::where('tag_id', Tag::PrivateInvestmentInPublicEquityFundId)->active()->get();
return $this->returnData($privateInvestmentInPublicEquityFund);
}
public function globalVentureCapitalFundQuestionAndAnswer()
{
$globalVentureCapitalFund = FAQ::where('tag_id', Tag::GlobalVentureCapitalFundId)->active()->where('faq_type', '0')->get();
return $this->returnData($globalVentureCapitalFund);
}
// faqs globalVentureCapitalFund
public function globalVentureCapitalFundQuestionAndAnswerFaqs()
{
$globalVentureCapitalFundFaqs = FAQ::where(['tag_id' => Tag::GlobalVentureCapitalFundId, 'faq_type' => '1'])->get();
return $this->returnData($globalVentureCapitalFundFaqs);
}
public function globalHedgeFundQuestionAndAnswer()
{
$globalHedgeFund = FAQ::where('tag_id', Tag::GlobalHedgeFundId)->active()->where('faq_type', '0')->get();
return $this->returnData($globalHedgeFund);
}
// faq
public function globalHedgeFundQuestionAndAnswerFaqs()
{
$globalHedgeFundFaqs = FAQ::where(['tag_id' => Tag::GlobalHedgeFundId, 'faq_type' => '1'])->get();
return $this->returnData($globalHedgeFundFaqs);
}
public function globalPrivateEquityFundQuestionAndAnswer()
{
$globalPrivateEquity = FAQ::where('tag_id', Tag::GlobalPrivateEquityFundId)->active()->where('faq_type', '0')->get();
return $this->returnData($globalPrivateEquity);
}
// faqs equities
public function globalPrivateEquityFundQuestionAndAnswerFaqs()
{
$globalPrivateEquityFaqs = FAQ::where(['tag_id' => Tag::GlobalPrivateEquityFundId, 'faq_type' => '1'])->get();
// dd($revenueBasedFinancing);
return $this->returnData($globalPrivateEquityFaqs);
}
public function sovereignGovernmentBondQuestionAndAnswer()
{
$soverignGovernmentBond = FAQ::where('tag_id', Tag::SovereignGovernmentBondId)->active()->get();
return $this->returnData($soverignGovernmentBond);
}
public function corporateBondInvestmentGradeQuestionAndAnswer()
{
$corporateBondInvestment = FAQ::where('tag_id', Tag::CorporateBondInvestmentGradeId)->active()->get();
return $this->returnData($corporateBondInvestment);
}
public function corporateBondHighYieldQuestionAndAnswer()
{
$corporateBondHighYield = FAQ::where('tag_id', Tag::CorporateBondHighYieldId)->active()->get();
return $this->returnData($corporateBondHighYield);
}
public function indianResidentialRealEstateQuestionAndAnswer()
{
$indianResidentialRealEstate = FAQ::where('tag_id', Tag::IndianResidentialRealEstateID)->active()->get();
return $this->returnData($indianResidentialRealEstate);
}
public function indianCommercialRealEstateQuestionAndAnswer()
{
$indianCommercialRealEstate = FAQ::where('tag_id', Tag::IndianCommercialRealEstateID)->active()->get();
return $this->returnData($indianCommercialRealEstate);
}
public function indianIndustrialRealEstateQuestionAndAnswer()
{
$indianIndustrialReal = FAQ::where('tag_id', Tag::IndianIndustrialRealEstateID)->active()->get();
return $this->returnData($indianIndustrialReal);
}
public function globalResidentialRealEstateQuestionAndAnswer()
{
$globalResidentialRealEstate = FAQ::where('tag_id', Tag::GlobalResidentialRealEstateID)->active()->get();
return $this->returnData($globalResidentialRealEstate);
}
public function globalCommercialRealEstateQuestionAndAnswer()
{
$globalCommercialRealEstate = FAQ::where('tag_id', Tag::GlobalCommercialRealEstateID)->active()->get();
return $this->returnData($globalCommercialRealEstate);
}
public function globalIndustrialRealEstateQuestionAndAnswer()
{
$globalIndustrialRealEstate = FAQ::where('tag_id', Tag::GlobalIndustrialRealEstateID)->active()->get();
return $this->returnData($globalIndustrialRealEstate);
}
public function returnData($data)
{
if ($data) {
return response()->json([
"status" => "success",
"code" => 200,
"data" => $data
]);
} else {
return response()->json([
"status" => "failed",
"code" => 400,
]);
}
}
}