Use cookies for dark mode
(also reverts most back-end changes from previous commit)
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user