Update Privacy Settings

This commit is contained in:
Daniel Supernault 2019-09-11 00:15:27 -06:00
parent 23bb12413b
commit 01352e04ea
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -29,14 +29,14 @@ trait PrivacySettings
public function privacyStore(Request $request)
{
$settings = Auth::user()->settings;
$profile = Auth::user()->profile;
$settings = $request->user()->settings;
$profile = $request->user()->profile;
$fields = [
'is_private',
'crawlable',
'show_profile_follower_count',
'show_profile_following_count',
];
];
foreach ($fields as $field) {
$form = $request->input($field);
if ($field == 'is_private') {
@ -65,7 +65,7 @@ trait PrivacySettings
}
$settings->save();
}
Cache::forget('profile:settings:' . $profile->id);
return redirect(route('settings.privacy'))->with('status', 'Settings successfully updated!');
}