Ale Gallo
b91cf0cbde
committing part of the laravel system with templating files and api implementation.
19 lines
371 B
PHP
19 lines
371 B
PHP
<?php
|
|
|
|
namespace App\View\Composers;
|
|
|
|
use Illuminate\View\View;
|
|
|
|
class DarkModeComposer
|
|
{
|
|
/**
|
|
* Bind dark mode value to the view.
|
|
*/
|
|
public function compose(View $view): void
|
|
{
|
|
$view->with(
|
|
'darkMode',
|
|
session()->has('dark_mode') ? filter_var(session('dark_mode'), FILTER_VALIDATE_BOOLEAN) : false
|
|
);
|
|
}
|
|
}
|