HEX
Server: nginx/1.28.3
System: Linux lightweb-s1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User: drdrivek-71 (1047)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/dnlightw-124/dn.lightweb.kr/app/Helpers/helpers.php
<?php

declare(strict_types=1);

use Rawilk\Settings\Settings;
use Rawilk\Settings\Support\Context;

if (! function_exists('siteConfigs')) {
    function siteConfigs($key = null, $default = null, $context = null)
    {
        /** @var Settings $siteConfigs */
        $siteConfigs = app(Settings::class);

        // If nothing is passed in to the function, simply return the settings instance.
        if ($key === null) {
            return $siteConfigs;
        }

        // If an array is passed, we are setting values.
        if (is_array($key)) {
            foreach ($key as $name => $value) {
                if ($context instanceof Context) {
                    $siteConfigs->context($context);
                }

                $siteConfigs->set(key: $name, value: $value);
            }

            return null;
        }

        if ($context instanceof Context || is_bool($context)) {
            $siteConfigs->context($context);
        }

        return $siteConfigs->get(key: $key, default: $default);
    }
}