<?php

namespace Laramin\Utility;

use App\Models\GeneralSetting;

class Helpmate{

    public static function sysPass(){
        $general = cache()->get('GeneralSetting');
        if (!$general) {
            $general = GeneralSetting::first();
        }

        if ($general->maintenance_mode == 9) {
            return 99;
        }

        return false;

    }

    public static function appUrl(){
        $current = @$_SERVER['REQUEST_SCHEME'] ?? 'http' . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
        $url = substr($current, 0, -9);
        return  $url;
    }

}

