芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/store.kwesioben.com/app/Http/Controllers/Admin/ProfileController.php
id())->first(); return view('admin-views.profile.view', compact('data')); } public function edit($id) { $data = Admin::where('id', $id)->first(); $shop_banner = Helpers::get_business_settings('shop_banner'); return view('admin-views.profile.edit', compact('data', 'shop_banner')); } public function update(Request $request, $id) { $admin = Admin::find($id); $admin->name = $request->name; $admin->phone = $request->phone; $admin->email = $request->email; if ($request->image) { $admin->image = ImageManager::update('admin/', $admin->image, 'png', $request->file('image')); } $admin->save(); Toastr::info(translate('profile_updated_successfully')); return back(); } public function settings_password_update(Request $request) { $request->validate([ 'password' => 'required|same:confirm_password|min:8', 'confirm_password' => 'required', ]); $admin = Admin::find(auth('admin')->id()); $admin->password = bcrypt($request['password']); $admin->save(); Toastr::success(translate('admin_password_updated_successfully')); return back(); } }