From 7ddaf844230197e575c87a3aa53440e5b22bc4fd Mon Sep 17 00:00:00 2001 From: Roy Duineveld Date: Tue, 16 Nov 2021 14:35:16 +0100 Subject: [PATCH] Do not try to render non implemented widgets in production --- src/ContentVariables/Widget.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ContentVariables/Widget.php b/src/ContentVariables/Widget.php index 5e7fb7684..433985292 100644 --- a/src/ContentVariables/Widget.php +++ b/src/ContentVariables/Widget.php @@ -20,8 +20,10 @@ public function __invoke($content) $widgetClass = config('rapidez.widgets.'.$type); - if (!class_exists($widgetClass) && !app()->environment('production')) { - return '
'.__('Widget not implemented (:type).', compact('type')).'
'; + if (!class_exists($widgetClass)) { + return !app()->environment('production') + ? '
'.__('Widget not implemented (:type).', compact('type')).'
' + : ''; } return (new $widgetClass((object) $options))->render();