From a2580f29ccd7cb70495b230a760d1a8da1290f59 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sat, 19 Jan 2019 01:17:56 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E8=A8=AD=E5=AE=9A=E3=81=A8=E3=83=97=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=90=E3=82=B7=E3=83=BC=E8=A8=AD=E5=AE=9A=E3=82=92=E5=88=86?= =?UTF-8?q?=E5=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/SettingController.php | 7 ++++- resources/views/setting/base.blade.php | 8 ++++-- resources/views/setting/privacy.blade.php | 33 ++++++++++++++++++++++ resources/views/setting/profile.blade.php | 28 ------------------ routes/web.php | 1 + 5 files changed, 46 insertions(+), 31 deletions(-) create mode 100644 resources/views/setting/privacy.blade.php diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 3187996..1f812e3 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -33,6 +33,11 @@ class SettingController extends Controller return redirect()->route('setting')->with('status', 'プロフィールを更新しました。'); } + public function privacy() + { + return view('setting.privacy'); + } + public function updatePrivacy(Request $request) { $inputs = $request->all(['is_protected', 'accept_analytics']); @@ -42,7 +47,7 @@ class SettingController extends Controller $user->accept_analytics = $inputs['accept_analytics'] ?? false; $user->save(); - return redirect()->route('setting')->with('status', 'プライバシー設定を更新しました。'); + return redirect()->route('setting.privacy')->with('status', 'プライバシー設定を更新しました。'); } // ( ◠‿◠ )☛ここに気づいたか・・・消えてもらう ▂▅▇█▓▒░(’ω’)░▒▓█▇▅▂うわあああああああ diff --git a/resources/views/setting/base.blade.php b/resources/views/setting/base.blade.php index f4a80fc..d3274cf 100644 --- a/resources/views/setting/base.blade.php +++ b/resources/views/setting/base.blade.php @@ -6,8 +6,12 @@
diff --git a/resources/views/setting/privacy.blade.php b/resources/views/setting/privacy.blade.php new file mode 100644 index 0000000..ce9cdc0 --- /dev/null +++ b/resources/views/setting/privacy.blade.php @@ -0,0 +1,33 @@ +@extends('setting.base') + +@section('title', 'プライバシー設定') + +@section('tab-content') +

プライバシー

+
+
+ {{ csrf_field() }} +
+
+ is_protected ) ? 'checked' : '' }}> + +
+
+ accept_analytics ) ? 'checked' : '' }}> + +
+
+ + +
+@endsection + +@push('script') + +@endpush diff --git a/resources/views/setting/profile.blade.php b/resources/views/setting/profile.blade.php index 41089ed..4bbe86a 100644 --- a/resources/views/setting/profile.blade.php +++ b/resources/views/setting/profile.blade.php @@ -29,32 +29,4 @@ - -

プライバシー

-
-
- {{ csrf_field() }} -
-
- is_protected ) ? 'checked' : '' }}> - -
-
- accept_analytics ) ? 'checked' : '' }}> - -
-
- - -
@endsection - -@push('script') - -@endpush \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 3645f36..d4c40ea 100644 --- a/routes/web.php +++ b/routes/web.php @@ -33,6 +33,7 @@ Route::middleware('auth')->group(function () { Route::redirect('/setting', '/setting/profile', 301); Route::get('/setting/profile', 'SettingController@profile')->name('setting'); Route::post('/setting/profile', 'SettingController@updateProfile')->name('setting.profile.update'); + Route::get('/setting/privacy', 'SettingController@privacy')->name('setting.privacy'); Route::post('/setting/privacy', 'SettingController@updatePrivacy')->name('setting.privacy.update'); // Route::get('/setting/password', 'SettingController@password')->name('setting.password'); });