FIX: fix update from migrations

This commit is contained in:
Michal Kváček
2016-09-20 20:58:52 +02:00
parent f25ef4ab1b
commit 40949eaa90
+9 -5
View File
@@ -14,12 +14,16 @@ class TemplateServiceProvider extends ServiceProvider
private function getTemplate()
{
// select template
$template = Module::where('is_template', true)
->where('enabled', true)
->first();
try {
$template = Module::where('is_template', true)
->where('enabled', true)
->first();
if ($template) {
$template->settings = json_decode($template->module_settings);
if ($template) {
$template->settings = json_decode($template->module_settings);
}
} catch (\Exception $e) {
return null;
}
return $template;