24 lines
549 B
PHP
24 lines
549 B
PHP
<?php
|
|
|
|
use App\Services\SettingsService;
|
|
|
|
if (! function_exists('settings')) {
|
|
/**
|
|
* Get the SettingsService instance
|
|
*
|
|
* @param string|null $key Optional key to get a specific setting
|
|
* @param mixed $default Default value if key is provided
|
|
* @return SettingsService|mixed
|
|
*/
|
|
function settings(?string $key = null, $default = null)
|
|
{
|
|
$service = app(SettingsService::class);
|
|
|
|
if ($key !== null) {
|
|
return $service->get($key, $default);
|
|
}
|
|
|
|
return $service;
|
|
}
|
|
}
|