Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
app
/
Http
/
Livewire
/
Admin
:
ChooseTheme.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php // this Code is Cracked by dharunMods-YouTube-Channel namespace App\Http\Livewire\Admin; use App\Models\Settings; use Livewire\Component; class ChooseTheme extends Component { public $theme; public $sucMsg; public function mount() { $set = Settings::select('id', 'theme')->find(1); $this->theme = $set->theme; } public function render() { $set = Settings::select('id', 'themes')->find(1); return view('livewire.admin.choose-theme', [ 'themes' => $set->themes, ]); } // save the theme back to the json column of settings table public function saveTheme(): void { $set = Settings::select('id', 'theme')->find(1); $set->theme = $this->theme; $set->save(); $this->sucMsg = 'Theme changed successfully'; } public function addNewTheme() { $settings = Settings::select('id', 'themes')->find(1); $themes = $settings->themes; $themes = array_merge($themes, ['millage', 'purpose', 'protodash']); $settings->themes = $themes; $settings->save(); } }