"require": {
"php": ">=7.1.3",
"umpirsky/locale-list": "^1.0",
- "umpirsky/country-list": "^2.0"
+ "umpirsky/country-list": "^2.0",
+ "laravel/framework": "^5.8"
},
"require-dev": {
},
},
"laravel": {
"providers": [
- "Cubist\\Locale\\CubistLocaleServiceProvider"
+
],
"aliases": {
--- /dev/null
+<?php
+
+
+namespace Cubist\Locale;
+
+
+class Locale extends LocalizedList
+{
+ protected static $_listPath = '/vendor/umpirsky/country-list/data/$locale/country.php';
+}
+++ /dev/null
-<?php
-
-namespace Cubist\Locale;
-
-use Illuminate\Support\ServiceProvider;
-
-class CubistBackpackServiceProvider extends ServiceProvider
-{
- /**
- * Indicates if loading of the provider is deferred.
- *
- * @var bool
- */
- protected $defer = false;
-
- const NAMESPACE = 'cubist_locale';
-
-
- /**
- * Perform post-registration booting of services.
- *
- * @return void
- */
- public function boot()
- {
-
- }
-
-
- /**
- * Register any package services.
- *
- * @return void
- */
- public function register()
- {
-
- }
-}
--- /dev/null
+<?php
+
+namespace Cubist\Locale;
+class LocalizedList
+{
+ protected static $_rawList = [];
+ protected static $_listPath='';
+
+ public static function getList($locale)
+ {
+ if (!isset(self::$_rawList[$locale])) {
+ self::$_rawList[$locale] = static::_getList($locale);
+ }
+ return self::$_rawList[$locale];
+ }
+
+ /**
+ * @param string $locale
+ * @return array
+ */
+ protected static function _getList($locale)
+ {
+ include base_path(str_replace('$locale',$locale,self::$_listPath));
+ }
+}
--- /dev/null
+<?php
+
+namespace Cubist\Locale;
+
+class Locale extends LocalizedList
+{
+ protected static $_listPath = '/vendor/umpirsky/locale-list/data/$locale/locales.php';
+}