diff --git a/app/Http/Controllers/Api/ApiBanWardenController.php b/app/Http/Controllers/Api/ApiBanWardenController.php index 4d37d5f99..fac2c0ec5 100644 --- a/app/Http/Controllers/Api/ApiBanWardenController.php +++ b/app/Http/Controllers/Api/ApiBanWardenController.php @@ -13,6 +13,7 @@ use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; +use Illuminate\Support\Arr; use Cache; class ApiBanWardenController extends ApiController @@ -45,7 +46,8 @@ public function postSyncPunishments(Request $request, GeolocationService $geoloc $banwardenEnabledInConfig = config('minetrax.banwarden.enabled'); $server = Server::where('id', $request->input('data.server_id'))->firstOrFail(); - if (!$banwardenEnabledInConfig || !$server->settings['is_banwarden_enabled']) { + $banwardenEnabledForServer = Arr::get($server->settings, 'is_banwarden_enabled', false); + if (!$banwardenEnabledInConfig || !$banwardenEnabledForServer) { return $this->error(__('BanWarden is disabled globally or on this server.'), 'banwarden_disabled', 403); } @@ -156,7 +158,8 @@ public function postReportPunishment(Request $request, GeolocationService $geolo $banwardenEnabledInConfig = config('minetrax.banwarden.enabled'); $server = Server::where('id', $request->input('data.server_id'))->firstOrFail(); - if (!$banwardenEnabledInConfig || !$server->settings['is_banwarden_enabled']) { + $banwardenEnabledForServer = Arr::get($server->settings, 'is_banwarden_enabled', false); + if (!$banwardenEnabledInConfig || !$banwardenEnabledForServer) { return $this->error(__('BanWarden is disabled globally or on this server.'), 'banwarden_disabled', 403); }