From 4654962aac7550274ea79c035f0a279e993734b8 Mon Sep 17 00:00:00 2001 From: shibafu Date: Fri, 19 Oct 2018 00:56:29 +0900 Subject: [PATCH 1/7] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E8=A8=AD=E5=AE=9A=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E3=82=8D=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/SettingController.php | 18 +++++++++ resources/views/layouts/base.blade.php | 2 +- resources/views/setting/base.blade.php | 18 +++++++++ resources/views/setting/profile.blade.php | 43 ++++++++++++++++++++++ routes/web.php | 4 ++ 5 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 app/Http/Controllers/SettingController.php create mode 100644 resources/views/setting/base.blade.php create mode 100644 resources/views/setting/profile.blade.php diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php new file mode 100644 index 0000000..de9a364 --- /dev/null +++ b/app/Http/Controllers/SettingController.php @@ -0,0 +1,18 @@ + - {{--設定--}} + 設定 ログアウト diff --git a/resources/views/setting/base.blade.php b/resources/views/setting/base.blade.php new file mode 100644 index 0000000..46ec3a3 --- /dev/null +++ b/resources/views/setting/base.blade.php @@ -0,0 +1,18 @@ +@extends('layouts.base') + +@section('content') +
+
+ +
+ @yield('tab-content') +
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/setting/profile.blade.php b/resources/views/setting/profile.blade.php new file mode 100644 index 0000000..29ea200 --- /dev/null +++ b/resources/views/setting/profile.blade.php @@ -0,0 +1,43 @@ +@extends('setting.base') + +@section('tab-content') +

プロフィール

+
+
+ {{ csrf_field() }} +
+ + +
+
+ +
+
+
@
+
+ +
+ 現在は変更できません。 +
+ + +
+ +

プライバシー

+
+
+ {{ csrf_field() }} +
+
+ + +
+
+ + +
+
+ + +
+@endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 5699e7e..b3b92f6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -37,3 +37,7 @@ Route::get('/info/{id}', 'InfoController@show')->where('id', '[0-9]+')->name('in Route::redirect('/search', '/search/checkin', 301); Route::get('/search/checkin', 'SearchController@index')->name('search'); Route::get('/search/related-tag', 'SearchController@relatedTag')->name('search.related-tag'); + +Route::redirect('/setting', '/setting/profile', 301); +Route::get('/setting/profile', 'SettingController@profile')->name('setting'); +Route::get('/setting/password', 'SettingController@password')->name('setting.password'); From 27532685baffc02a332804aad74924b0bd27e5f1 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sun, 30 Dec 2018 23:19:52 +0900 Subject: [PATCH 2/7] =?UTF-8?q?POST=E5=85=88=E3=83=AB=E3=83=BC=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/SettingController.php | 10 ++++++++++ resources/views/setting/profile.blade.php | 16 +++++++++++++--- routes/web.php | 10 ++++++---- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index de9a364..3f71323 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -11,6 +11,16 @@ class SettingController extends Controller return view('setting.profile'); } + public function updateProfile() + { + abort(501); + } + + public function updatePrivacy() + { + abort(501); + } + public function password() { abort(501); diff --git a/resources/views/setting/profile.blade.php b/resources/views/setting/profile.blade.php index 29ea200..66d97e8 100644 --- a/resources/views/setting/profile.blade.php +++ b/resources/views/setting/profile.blade.php @@ -3,7 +3,7 @@ @section('tab-content')

プロフィール


-
+ {{ csrf_field() }}
@@ -25,7 +25,7 @@

プライバシー


- + {{ csrf_field() }}
@@ -40,4 +40,14 @@ -@endsection \ No newline at end of file +@endsection + +@push('script') + +@endpush \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index b3b92f6..9edaa98 100644 --- a/routes/web.php +++ b/routes/web.php @@ -29,6 +29,12 @@ Route::middleware('auth')->group(function () { Route::get('/checkin/{id}/edit', 'EjaculationController@edit')->name('checkin.edit'); Route::put('/checkin/{id}', 'EjaculationController@update')->name('checkin.update'); Route::delete('/checkin/{id}', 'EjaculationController@destroy')->name('checkin.destroy'); + + 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::post('/setting/privacy', 'SettingController@updatePrivacy')->name('setting.privacy.update'); + Route::get('/setting/password', 'SettingController@password')->name('setting.password'); }); Route::get('/info', 'InfoController@index')->name('info'); @@ -37,7 +43,3 @@ Route::get('/info/{id}', 'InfoController@show')->where('id', '[0-9]+')->name('in Route::redirect('/search', '/search/checkin', 301); Route::get('/search/checkin', 'SearchController@index')->name('search'); Route::get('/search/related-tag', 'SearchController@relatedTag')->name('search.related-tag'); - -Route::redirect('/setting', '/setting/profile', 301); -Route::get('/setting/profile', 'SettingController@profile')->name('setting'); -Route::get('/setting/password', 'SettingController@password')->name('setting.password'); From 550d897561008060977a33d18abb89d7c2dfaba3 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sat, 19 Jan 2019 00:13:34 +0900 Subject: [PATCH 3/7] =?UTF-8?q?=E6=98=8E=E6=97=A5=E3=82=84=E3=82=8D?= =?UTF-8?q?=E3=81=86=E3=81=AF=E9=A6=AC=E9=B9=BF=E3=82=84=E3=82=8D=E3=81=86?= =?UTF-8?q?=EF=BC=9F=E7=9F=A5=E3=82=89=E3=81=AD=E3=81=87=E3=81=AA=E3=81=81?= =?UTF-8?q?=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/SettingController.php | 9 +++++---- resources/views/setting/base.blade.php | 2 +- routes/web.php | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 3f71323..7f60aa2 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -21,8 +21,9 @@ class SettingController extends Controller abort(501); } - public function password() - { - abort(501); - } + // ( ◠‿◠ )☛ここに気づいたか・・・消えてもらう ▂▅▇█▓▒░(’ω’)░▒▓█▇▅▂うわあああああああ +// public function password() +// { +// abort(501); +// } } diff --git a/resources/views/setting/base.blade.php b/resources/views/setting/base.blade.php index 46ec3a3..f4a80fc 100644 --- a/resources/views/setting/base.blade.php +++ b/resources/views/setting/base.blade.php @@ -7,7 +7,7 @@
diff --git a/routes/web.php b/routes/web.php index 9edaa98..3645f36 100644 --- a/routes/web.php +++ b/routes/web.php @@ -34,7 +34,7 @@ Route::middleware('auth')->group(function () { Route::get('/setting/profile', 'SettingController@profile')->name('setting'); Route::post('/setting/profile', 'SettingController@updateProfile')->name('setting.profile.update'); Route::post('/setting/privacy', 'SettingController@updatePrivacy')->name('setting.privacy.update'); - Route::get('/setting/password', 'SettingController@password')->name('setting.password'); +// Route::get('/setting/password', 'SettingController@password')->name('setting.password'); }); Route::get('/info', 'InfoController@index')->name('info'); From 53b459740f743efa6cce652ff4d15081d53126b2 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sat, 19 Jan 2019 00:29:36 +0900 Subject: [PATCH 4/7] =?UTF-8?q?=E3=83=97=E3=83=A9=E3=82=A4=E3=83=90?= =?UTF-8?q?=E3=82=B7=E3=83=BC=E8=A8=AD=E5=AE=9A=E3=81=AE=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/SettingController.php | 13 +++++++++++-- resources/views/setting/profile.blade.php | 8 ++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 7f60aa2..b278b1e 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -3,6 +3,8 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Validator; class SettingController extends Controller { @@ -16,9 +18,16 @@ class SettingController extends Controller abort(501); } - public function updatePrivacy() + public function updatePrivacy(Request $request) { - abort(501); + $inputs = $request->all(['is_protected', 'accept_analytics']); + + $user = Auth::user(); + $user->is_protected = $inputs['is_protected'] ?? false; + $user->accept_analytics = $inputs['accept_analytics'] ?? false; + $user->save(); + + return redirect()->route('setting')->with('status', 'プライバシー設定を更新しました。'); } // ( ◠‿◠ )☛ここに気づいたか・・・消えてもらう ▂▅▇█▓▒░(’ω’)░▒▓█▇▅▂うわあああああああ diff --git a/resources/views/setting/profile.blade.php b/resources/views/setting/profile.blade.php index 66d97e8..5563422 100644 --- a/resources/views/setting/profile.blade.php +++ b/resources/views/setting/profile.blade.php @@ -7,7 +7,7 @@ {{ csrf_field() }}
- +
@@ -15,7 +15,7 @@
@
- +
現在は変更できません。
@@ -29,11 +29,11 @@ {{ csrf_field() }}
- + is_protected ) ? 'checked' : '' }}>
- + accept_analytics ) ? 'checked' : '' }}>
From 5d256519c67291f9a68e5fbc22b26e3f0a980269 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sat, 19 Jan 2019 00:32:56 +0900 Subject: [PATCH 5/7] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E8=A8=AD=E5=AE=9A=E7=94=BB=E9=9D=A2=E3=81=AE?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/setting/profile.blade.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/views/setting/profile.blade.php b/resources/views/setting/profile.blade.php index 5563422..d0dd5c0 100644 --- a/resources/views/setting/profile.blade.php +++ b/resources/views/setting/profile.blade.php @@ -1,5 +1,7 @@ @extends('setting.base') +@section('title', 'プロフィール設定') + @section('tab-content')

プロフィール


From 85cc86554552bc0680973271b1c4d947ab46c6d3 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sat, 19 Jan 2019 00:39:57 +0900 Subject: [PATCH 6/7] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E8=A8=AD=E5=AE=9A=E3=81=AE=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/SettingController.php | 19 +++++++++++++++++-- resources/views/setting/profile.blade.php | 7 ++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index b278b1e..3187996 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -13,9 +13,24 @@ class SettingController extends Controller return view('setting.profile'); } - public function updateProfile() + public function updateProfile(Request $request) { - abort(501); + $inputs = $request->all(); + $validator = Validator::make($inputs, [ + 'display_name' => 'required|string|max:20' + ], [], [ + 'display_name' => '名前' + ]); + + if ($validator->fails()) { + return redirect()->route('setting')->withErrors($validator)->withInput(); + } + + $user = Auth::user(); + $user->display_name = $inputs['display_name']; + $user->save(); + + return redirect()->route('setting')->with('status', 'プロフィールを更新しました。'); } public function updatePrivacy(Request $request) diff --git a/resources/views/setting/profile.blade.php b/resources/views/setting/profile.blade.php index d0dd5c0..41089ed 100644 --- a/resources/views/setting/profile.blade.php +++ b/resources/views/setting/profile.blade.php @@ -9,7 +9,12 @@ {{ csrf_field() }}
- + + + @if ($errors->has('display_name')) +
{{ $errors->first('display_name') }}
+ @endif
From a2580f29ccd7cb70495b230a760d1a8da1290f59 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sat, 19 Jan 2019 01:17:56 +0900 Subject: [PATCH 7/7] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E8=A8=AD=E5=AE=9A=E3=81=A8=E3=83=97=E3=83=A9?= =?UTF-8?q?=E3=82=A4=E3=83=90=E3=82=B7=E3=83=BC=E8=A8=AD=E5=AE=9A=E3=82=92?= =?UTF-8?q?=E5=88=86=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'); });