いいね一覧の公開設定を追加

This commit is contained in:
shibafu 2019-04-09 22:59:10 +09:00
parent c20a8066c9
commit ddac533539
2 changed files with 7 additions and 1 deletions

View File

@ -46,11 +46,12 @@ class SettingController extends Controller
public function updatePrivacy(Request $request)
{
$inputs = $request->all(['is_protected', 'accept_analytics']);
$inputs = $request->all(['is_protected', 'accept_analytics', 'private_likes']);
$user = Auth::user();
$user->is_protected = $inputs['is_protected'] ?? false;
$user->accept_analytics = $inputs['accept_analytics'] ?? false;
$user->private_likes = $inputs['private_likes'] ?? false;
$user->save();
return redirect()->route('setting.privacy')->with('status', 'プライバシー設定を更新しました。');

View File

@ -11,6 +11,11 @@
<div class="custom-control custom-checkbox mb-2">
<input id="protected" name="is_protected" class="custom-control-input" type="checkbox" {{ (old('is_protected') ?? Auth::user()->is_protected ) ? 'checked' : '' }}>
<label class="custom-control-label" for="protected">全てのチェックイン履歴を非公開にする</label>
<small class="form-text text-muted">プロフィール情報を除いて、全ての情報が非公開になります。</small>
</div>
<div class="custom-control custom-checkbox mb-2">
<input id="private-likes" name="private_likes" class="custom-control-input" type="checkbox" {{ (old('private_likes') ?? Auth::user()->private_likes ) ? 'checked' : '' }}>
<label class="custom-control-label" for="private-likes">いいねしたチェックイン一覧を非公開にする</label>
</div>
<div class="custom-control custom-checkbox">
<input id="accept-analytics" name="accept_analytics" class="custom-control-input" type="checkbox" {{ (old('accept_analytics') ?? Auth::user()->accept_analytics ) ? 'checked' : '' }}>