FEATURE: more changes to article and article list
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user