芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/myvyralapp.com/bck/app/Http/Controllers/Admin/TrxSettingsController.php
all(),[ 'slug' => 'required|string', $request->slug.'_fixed_charge' => 'required|numeric', $request->slug.'_percent_charge' => 'required|numeric', $request->slug.'_min_limit' => 'required|numeric', $request->slug.'_max_limit' => 'required|numeric', $request->slug.'_daily_limit' => 'sometimes|required|numeric', $request->slug.'_monthly_limit' => 'sometimes|required|numeric', ]); $validated = $validator->validate(); $transaction_setting = TransactionSetting::where('slug',$request->slug)->first(); if(!$transaction_setting) return back()->with(['error' => ['Transaction charge not found!']]); $validated = replace_array_key($validated,$request->slug."_"); try{ $transaction_setting->update($validated); }catch(Exception $e) { return back()->with(['error' => ["Something went worng! Please try again."]]); } return back()->with(['success' => ['Charge Updated Successfully!']]); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // } /** * 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) { // } }