Skip to content

Commit

Permalink
Do not try to render non implemented widgets in production
Browse files Browse the repository at this point in the history
  • Loading branch information
royduin committed Nov 16, 2021
1 parent a98fe6f commit 7ddaf84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ContentVariables/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ public function __invoke($content)

$widgetClass = config('rapidez.widgets.'.$type);

if (!class_exists($widgetClass) && !app()->environment('production')) {
return '<hr>'.__('Widget not implemented (:type).', compact('type')).'<hr>';
if (!class_exists($widgetClass)) {
return !app()->environment('production')
? '<hr>'.__('Widget not implemented (:type).', compact('type')).'<hr>'
: '';
}

return (new $widgetClass((object) $options))->render();
Expand Down

0 comments on commit 7ddaf84

Please sign in to comment.