Applied fixes from StyleCI

This commit is contained in:
Manish Verma
2016-10-20 13:29:35 +00:00
committed by StyleCI Bot
parent ee1de58cdc
commit d8f88103e3
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(); $code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
if (!count($code)) { if (!count($code)) {
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput(); return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
} }
$user->country_code = $request->country_code; $user->country_code = $request->country_code;
} }
$user->fill($request->except('profile_pic', 'mobile')); $user->fill($request->except('profile_pic', 'mobile'));
$user->gender = $request->input('gender'); $user->gender = $request->input('gender');
$user->save(); $user->save();
if (Input::file('profile_pic')) { if (Input::file('profile_pic')) {
// fetching picture name // fetching picture name
$name = Input::file('profile_pic')->getClientOriginalName(); $name = Input::file('profile_pic')->getClientOriginalName();
// fetching upload destination path // fetching upload destination path
$destinationPath = 'uploads/profilepic'; $destinationPath = 'uploads/profilepic';
@@ -702,11 +702,10 @@ class UserController extends Controller
$user->mobile = null; $user->mobile = null;
} }
if ($user->save()) { 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 { } else {
return Redirect::route('profile')->with('fails', Lang::get('lang.Profile-Updated-sucessfully')); return Redirect::route('profile')->with('fails', Lang::get('lang.Profile-Updated-sucessfully'));
} }
} catch (Exception $e) { } catch (Exception $e) {
return Redirect::route('profile')->with('fails', $e->getMessage()); 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(); $code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
if (!count($code)) { if (!count($code)) {
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput(); return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
} }
$user->country_code = $request->country_code; $user->country_code = $request->country_code;
} }
$user->fill($request->except('profile_pic', 'mobile')); $user->fill($request->except('profile_pic', 'mobile'));
$user->gender = $request->input('gender'); $user->gender = $request->input('gender');
$user->save(); $user->save();
if (Input::file('profile_pic')) { if (Input::file('profile_pic')) {
// fetching picture name // fetching picture name
$name = Input::file('profile_pic')->getClientOriginalName(); $name = Input::file('profile_pic')->getClientOriginalName();
// fetching upload destination path // fetching upload destination path
$destinationPath = 'uploads/profilepic'; $destinationPath = 'uploads/profilepic';
@@ -113,11 +113,10 @@ class GuestController extends Controller
$user->mobile = null; $user->mobile = null;
} }
if ($user->save()) { 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 { } else {
return redirect()->back()->route('profile')->with('fails', Lang::get('lang.Profile-Updated-sucessfully')); return redirect()->back()->route('profile')->with('fails', Lang::get('lang.Profile-Updated-sucessfully'));
} }
} catch (Exception $e) { } catch (Exception $e) {
return redirect()->back()->route('profile')->with('fails', $e->getMessage()); return redirect()->back()->route('profile')->with('fails', $e->getMessage());
} }