only(['name', 'email', 'introduction']); if ($request->file('avatar')) { $user->avatar = $request->file('avatar')->store('public/avatar'); } $user->update($attribute); return redirect()->route('users.show', [$user])->with('success', '更新成功!'); } }