POST先ルート追加

This commit is contained in:
shibafu 2018-12-30 23:19:52 +09:00
parent 4654962aac
commit 27532685ba
3 changed files with 29 additions and 7 deletions

View File

@ -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);

View File

@ -3,7 +3,7 @@
@section('tab-content')
<h3>プロフィール</h3>
<hr>
<form action="" method="post">
<form action="{{ route('setting.profile.update') }}" method="post">
{{ csrf_field() }}
<div class="from-group">
<label for="display_name">名前</label>
@ -25,7 +25,7 @@
<h3 class="mt-5">プライバシー</h3>
<hr>
<form action="" method="post">
<form action="{{ route('setting.privacy.update') }}" method="post">
{{ csrf_field() }}
<div class="form-group">
<div class="custom-control custom-checkbox mb-2">
@ -40,4 +40,14 @@
<button type="submit" class="btn btn-primary mt-2">更新</button>
</form>
@endsection
@endsection
@push('script')
<script>
$('#protected').on('change', function () {
if (!$(this).prop('checked')) {
alert('チェックイン履歴を公開に切り替えると、個別に非公開設定されているものを除いた全てのチェックインが誰でも閲覧できるようになります。\nご注意ください。');
}
});
</script>
@endpush

View File

@ -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');