Merge pull request #259 from ladybirdweb/analysis-8AbLMP

Applied fixes from StyleCI
This commit is contained in:
Manish Verma
2016-10-20 18:59:48 +05:30
committed by GitHub
2 changed files with 6 additions and 8 deletions

View File

@@ -678,14 +678,14 @@ class UserController extends Controller
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
if (!count($code)) {
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
}
}
$user->country_code = $request->country_code;
}
$user->fill($request->except('profile_pic', 'mobile'));
$user->gender = $request->input('gender');
$user->save();
if (Input::file('profile_pic')) {
// fetching picture name
// fetching picture name
$name = Input::file('profile_pic')->getClientOriginalName();
// fetching upload destination path
$destinationPath = 'uploads/profilepic';
@@ -702,11 +702,10 @@ class UserController extends Controller
$user->mobile = null;
}
if ($user->save()) {
return Redirect::route('profile')->with('success', Lang::get('lang.Profile-Updated-sucessfully'));
return Redirect::route('profile')->with('success', Lang::get('lang.Profile-Updated-sucessfully'));
} else {
return Redirect::route('profile')->with('fails', Lang::get('lang.Profile-Updated-sucessfully'));
}
} catch (Exception $e) {
return Redirect::route('profile')->with('fails', $e->getMessage());
}

View File

@@ -89,14 +89,14 @@ class GuestController extends Controller
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
if (!count($code)) {
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
}
}
$user->country_code = $request->country_code;
}
$user->fill($request->except('profile_pic', 'mobile'));
$user->gender = $request->input('gender');
$user->save();
if (Input::file('profile_pic')) {
// fetching picture name
// fetching picture name
$name = Input::file('profile_pic')->getClientOriginalName();
// fetching upload destination path
$destinationPath = 'uploads/profilepic';
@@ -113,11 +113,10 @@ class GuestController extends Controller
$user->mobile = null;
}
if ($user->save()) {
return redirect()->back()->with('success', Lang::get('lang.Profile-Updated-sucessfully'));
return redirect()->back()->with('success', Lang::get('lang.Profile-Updated-sucessfully'));
} else {
return redirect()->back()->route('profile')->with('fails', Lang::get('lang.Profile-Updated-sucessfully'));
}
} catch (Exception $e) {
return redirect()->back()->route('profile')->with('fails', $e->getMessage());
}