Initial Commit
The initial public commit of MVGL website code.
This commit is contained in:
commit
b39ecf1638
2043 changed files with 215154 additions and 0 deletions
27
app/Http/Controllers/UserSiteSettingController.php
Normal file
27
app/Http/Controllers/UserSiteSettingController.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\UserSiteSetting;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class UserSiteSettingController extends Controller
|
||||
{
|
||||
/**
|
||||
* Set the users dark mode setting.
|
||||
*
|
||||
* @param string $mode Dark mode setting, either 'yes' or 'no'.
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public static function setDarkMode($mode)
|
||||
{
|
||||
// Get the user as an object.
|
||||
$user = auth()->user();
|
||||
|
||||
$result = DB::table('user_site_settings')->updateOrInsert(
|
||||
['user_id' => $user->id, 'setting_name' => 'dark_mode'],
|
||||
['setting_value' => $mode]
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue