|
|
@ -27,20 +27,41 @@ class ProfileController extends Controller |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Edit own profile |
|
|
|
* Edit own profile (this does not include auth settings etc) |
|
|
|
* |
|
|
|
* |
|
|
|
* @param User $user |
|
|
|
* @param User $user |
|
|
|
* @return \Illuminate\View\View |
|
|
|
* @return \Illuminate\View\View |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function edit() |
|
|
|
public function editProfile() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return view('profile.edit')->with('user', \user()); |
|
|
|
return view('profile.edit-profile')->with('user', \user()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function editAccount() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return view('profile.edit-account', ['user' => user()]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Store changed profile |
|
|
|
* Store changed profile |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function store(Request $request) |
|
|
|
public function storeProfile(Request $request) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$input = $this->validate($request, [ |
|
|
|
|
|
|
|
'bio' => ['nullable', VALI_TEXT], |
|
|
|
|
|
|
|
'title' => ['required', VALI_LINE], |
|
|
|
|
|
|
|
'website' => ['required', VALI_LINE], |
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$user = user(); |
|
|
|
|
|
|
|
$user->fill($input->all()); |
|
|
|
|
|
|
|
$user->save(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flash()->success('Settings saved'); |
|
|
|
|
|
|
|
return back(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function storeAccount(Request $request) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$input = $this->validate($request, [ |
|
|
|
$input = $this->validate($request, [ |
|
|
|
'name' => [ |
|
|
|
'name' => [ |
|
|
@ -53,9 +74,6 @@ class ProfileController extends Controller |
|
|
|
VALI_EMAIL, |
|
|
|
VALI_EMAIL, |
|
|
|
Rule::unique('users')->ignoreModel(\user()), |
|
|
|
Rule::unique('users')->ignoreModel(\user()), |
|
|
|
], |
|
|
|
], |
|
|
|
'bio' => ['nullable', VALI_TEXT], |
|
|
|
|
|
|
|
'title' => ['required', VALI_LINE], |
|
|
|
|
|
|
|
'website' => ['required', VALI_LINE], |
|
|
|
|
|
|
|
'new_password' => ['nullable', 'confirmed', VALI_PASSWORD], |
|
|
|
'new_password' => ['nullable', 'confirmed', VALI_PASSWORD], |
|
|
|
]); |
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
@ -90,11 +108,6 @@ class ProfileController extends Controller |
|
|
|
return back(); |
|
|
|
return back(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function manageOauth() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return view('profile.logins', ['user' => user()]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function forgetSocialLogin($id) |
|
|
|
public function forgetSocialLogin($id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$identity = user()->socialIdentities()->where('id', $id)->first(); |
|
|
|
$identity = user()->socialIdentities()->where('id', $id)->first(); |
|
|
|