Use cookies for dark mode

(also reverts most back-end changes from previous commit)
This commit is contained in:
2018-08-06 16:02:42 +02:00
parent 9fd6890667
commit a63e605a15
11 changed files with 98 additions and 11 deletions
+9
View File
@@ -69,3 +69,12 @@ Route::group(['middleware' => 'auth'], function () {
Route::get('forget-social-login/{id}', 'AccountController@forgetSocialLogin')->name('forget-identity');
});
});
Route::post('toggle-dark-mode', function () {
if (dark_mode()) {
setcookie('dark_mode', '0', time() - 1);
} else {
setcookie('dark_mode', '1');
}
return redirect()->back();
})->name('toggle-dark-mode');