Changeset View
Changeset View
Standalone View
Standalone View
src/app/Utils.php
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | class Utils | ||||
* the UI | * the UI | ||||
* | * | ||||
* @todo For a lack of better place this is put here for now | * @todo For a lack of better place this is put here for now | ||||
* | * | ||||
* @return array Configuration data | * @return array Configuration data | ||||
*/ | */ | ||||
public static function uiEnv(): array | public static function uiEnv(): array | ||||
{ | { | ||||
$opts = ['app.name', 'app.url', 'app.domain']; | $opts = ['app.name', 'app.url', 'app.domain', 'app.theme']; | ||||
$env = \app('config')->getMany($opts); | $env = \app('config')->getMany($opts); | ||||
$countries = include resource_path('countries.php'); | $countries = include resource_path('countries.php'); | ||||
$env['countries'] = $countries ?: []; | $env['countries'] = $countries ?: []; | ||||
$isAdmin = strpos(request()->getHttpHost(), 'admin.') === 0; | $isAdmin = strpos(request()->getHttpHost(), 'admin.') === 0; | ||||
$env['jsapp'] = $isAdmin ? 'admin.js' : 'user.js'; | $env['jsapp'] = $isAdmin ? 'admin.js' : 'user.js'; | ||||
$env['paymentProvider'] = \config('services.payment_provider'); | $env['paymentProvider'] = \config('services.payment_provider'); | ||||
$env['stripePK'] = \config('services.stripe.public_key'); | $env['stripePK'] = \config('services.stripe.public_key'); | ||||
return $env; | return $env; | ||||
} | } | ||||
} | } |