category_name; $category_id = $category->id; $excelFileName = 'PrivateCreditTemplate.xlsx'; $route = route('manage.private-credit-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) { // dd($request->all()); 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')); // dd('he') // 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) { // } /** * 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) { // } }