FEATURE: prepare for installing templates
This commit is contained in:
@@ -5,18 +5,13 @@ use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||
use Symfony\Component\Translation\Translator;
|
||||
|
||||
class LaravelLocalizationServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register()
|
||||
{
|
||||
try {
|
||||
$languages = DB::table('languages')
|
||||
->get();
|
||||
} catch (\Exception $e) {
|
||||
$languages = [];
|
||||
}
|
||||
$languages = DB::table('languages')
|
||||
->get();
|
||||
|
||||
$supportedLocales = [];
|
||||
if (empty($languages)) {
|
||||
@@ -28,11 +23,7 @@ class LaravelLocalizationServiceProvider extends ServiceProvider
|
||||
];
|
||||
|
||||
// create default language
|
||||
try {
|
||||
Language::create($supportedLocales[config('app.locale')]);
|
||||
} catch (\Exception $e) {
|
||||
// ignore, table languages probably does not exist.
|
||||
}
|
||||
Language::create($supportedLocales[config('app.locale')]);
|
||||
}
|
||||
|
||||
foreach ($languages as $language) {
|
||||
|
||||
Reference in New Issue
Block a user