category_name; $category_id = $category->id; $excelFileName = 'LongOnlyFundsTemplate.xlsx'; $route = route('manage.long-only-equity-fund.store'); return view('Admin.Pages.manage_freeu_investment.upload-product.alternative-investment-fund', compact('text', 'category_id', 'excelFileName','route')); } /** * 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 AlternativeInvestmentFundImport($category_type), $request->file('productFile')); // return back()->with('success', "$category->category_name Imported Successfully."); return back()->with('success', "$category->category_name Imported Successfully."); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $alternativeInvestmentFund = Product::with('category', 'alternativeInvestmentFund','product_images')->alternativeInvestmentFund()->find($id); // dd(Product::find($id)); // dd($alternativeInvestmentFund); return view('Admin.Pages.manage_freeu_investment.view-product.alternative-investment-fund', compact('alternativeInvestmentFund')); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } }