diff --git a/src/app/Utils.php b/src/app/Utils.php index c3bec8ff..a894a8fe 100644 --- a/src/app/Utils.php +++ b/src/app/Utils.php @@ -1,78 +1,97 @@ = $n) { return; } // current is included, put next at next location $data[$index] = $input[$i]; self::combine($input, $r, $index + 1, $data, $i + 1, $output); // current is excluded, replace it with next (Note that i+1 // is passed, but index is not changed) self::combine($input, $r, $index, $data, $i + 1, $output); } + + /** + * Create a configuration/environment data to be passed to + * the UI + * + * @todo For a lack of better place this is put here for now + * + * @return array Configuration data + */ + public static function uiEnv(): array + { + $opts = ['app.name', 'app.url', 'app.domain']; + $env = \app('config')->getMany($opts); + + $countries = include resource_path('countries.php'); + $env['countries'] = $countries ?: []; + + return $env; + } } diff --git a/src/resources/views/layouts/app.blade.php b/src/resources/views/layouts/app.blade.php index 463a090d..fd6754d5 100644 --- a/src/resources/views/layouts/app.blade.php +++ b/src/resources/views/layouts/app.blade.php @@ -1,22 +1,22 @@ {{ config('app.name') }} -- @yield('title') {{-- TODO: PWA disabled for now: @laravelPWA --}}
@yield('content')
- + diff --git a/src/routes/web.php b/src/routes/web.php index f5d96ba6..0fa1d67c 100644 --- a/src/routes/web.php +++ b/src/routes/web.php @@ -1,19 +1,19 @@ with('env', \App\Utils::uiEnv()); });