FEATURE: more changes to article and article list

This commit is contained in:
Peter Hrdlica
2016-10-10 21:36:55 +02:00
99 changed files with 17117 additions and 53 deletions
+8 -2
View File
@@ -2,6 +2,9 @@
namespace App\Helpers;
use App\Models\Module;
use DebugBar\Bridge\MonologCollector;
use Illuminate\Database\QueryException;
use Monolog\Logger;
class CurrentTemplate
{
@@ -10,16 +13,19 @@ class CurrentTemplate
/**
* Getter for currently set template
*
* @return Module
* @throws \ErrorException
*/
public static function get()
{
if (!self::$initialized) {
try {
self::$template = Module::where('is_template', true)
->where('enabled', true)
->first();
} catch (QueryException $e) {
throw new \ErrorException('DB not migrated, please, do so!');
}
if (self::$template) {
self::$template->module_settings = json_decode(self::$template->module_settings);
}