pianello-api/app/Http/Controllers/DarkModeController.php
Ale Gallo b91cf0cbde Committing laravel + api (part 1)
committing part of the laravel system with templating files and api implementation.
2023-11-10 15:54:41 +01:00

21 lines
387 B
PHP

<?php
namespace App\Http\Controllers;
use Illuminate\Http\RedirectResponse;
class DarkModeController extends Controller
{
/**
* Switch dark/light mode.
*
*/
public function switch(): RedirectResponse
{
session([
'dark_mode' => session()->has('dark_mode') ? !session()->get('dark_mode') : true
]);
return back();
}
}