REFACTORING #1880 @4h30m: another ugly refactoring commit

This commit is contained in:
Michal Kváček
2016-10-25 16:50:04 +02:00
parent 28f67ffe3c
commit cc999dd24e
71 changed files with 827 additions and 608 deletions
@@ -1,7 +1,5 @@
<?php namespace App\Providers;
use App\Models\Language;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\ServiceProvider;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
@@ -16,14 +14,14 @@ class LaravelLocalizationServiceProvider extends ServiceProvider
$supportedLocales = [];
if (empty($languages)) {
$supportedLocales[config('app.locale')] = [
'native' => env('LOCALE_NATIVE_NAME'),
'script' => env('LOCALE_SCRIPT'),
'name' => env('LOCALE_TRANSLATED_NAME'),
'native' => env('LOCALE_NATIVE_NAME', config('app.locale')),
'script' => env('LOCALE_SCRIPT', 'Latn'),
'name' => env('LOCALE_TRANSLATED_NAME', config('app.locale')),
'code' => config('app.locale'),
];
// create default language
Language::create($supportedLocales[config('app.locale')]);
DB::table('languages')
->insert($supportedLocales[config('app.locale')]);
}
foreach ($languages as $language) {