Skip to content

Commit

Permalink
Update SettingsController.php - Remove discord settings
Browse files Browse the repository at this point in the history
  • Loading branch information
1day2die authored Nov 11, 2024
1 parent 599c525 commit 03c2cac
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions app/Http/Controllers/Admin/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Illuminate\Contracts\View\View;
use Illuminate\Http\Response;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Validator;
use Qirolab\Theme\Theme;
Expand Down Expand Up @@ -123,19 +122,6 @@ public function update(Request $request)
$rp = new \ReflectionProperty($settingsClass, $key);
$rpType = $rp->getType();

// Check if the settingsclass is a DiscordSettings class
if($settings_class == 'App\Settings\DiscordSettings') {
if($key === 'client_id' || $key === 'client_secret') {

$env = file_get_contents(base_path('.env'));
$env = preg_replace('/DISCORD_CLIENT_ID=(.*)/', 'DISCORD_CLIENT_ID=' . $request->input('client_id'), $env);
$env = preg_replace('/DISCORD_CLIENT_SECRET=(.*)/', 'DISCORD_CLIENT_SECRET=' . $request->input('client_secret'), $env);
file_put_contents(base_path('.env'), $env);

Artisan::call('config:clear');
}
}

if ($rpType == 'bool') {
$settingsClass->$key = $request->has($key);
continue;
Expand Down

0 comments on commit 03c2cac

Please sign in to comment.