Set SettingService behind a Facade

This commit is contained in:
Bubka
2022-07-30 17:51:02 +02:00
parent be632bb489
commit f7ac1e96c3
21 changed files with 101 additions and 208 deletions

View File

@ -7,6 +7,7 @@ use Carbon\Carbon;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
use App\Facades\Settings;
class KickOutInactiveUser
{
@ -32,8 +33,7 @@ class KickOutInactiveUser
$inactiveFor = $now->diffInSeconds(Carbon::parse($user->last_seen_at));
// Fetch all setting values
$settingService = resolve('App\Services\SettingService');
$kickUserAfterXSecond = intval($settingService->get('kickUserAfter')) * 60;
$kickUserAfterXSecond = intval(Settings::get('kickUserAfter')) * 60;
// If user has been inactive longer than the allowed inactivity period
if ($kickUserAfterXSecond > 0 && $inactiveFor > $kickUserAfterXSecond) {