render('profile.index'); } /** * Update the specified resource in storage. * * @param UpdateContactRequest $request * @param ClientContact $client_contact * @return \Illuminate\Http\RedirectResponse */ public function update(UpdateContactRequest $request, ClientContact $client_contact) { $client_contact->fill($request->all()); if ($request->has('password')) { $client_contact->password = encrypt($request->password); } $client_contact->save(); return back()->withSuccess( ctrans('texts.profile_updated_successfully') ); } public function updateClient(UpdateClientRequest $request, ClientContact $client_contact) { $client = $client_contact->client; //update avatar if needed if ($request->file('logo')) { $path = (new UploadAvatar($request->file('logo'), $client->client_hash))->handle(); if ($path) { $client->logo = $path; } } $client->fill($request->all()); $client->save(); return back()->withSuccess( ctrans('texts.profile_updated_successfully') ); } }