Initial commit
This commit is contained in:
23
app/helpers.php
Normal file
23
app/helpers.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user