From a93fb498751d097121273e7b009ec64313e5bc65 Mon Sep 17 00:00:00 2001 From: ullbergm Date: Thu, 7 Jun 2018 17:35:01 -0400 Subject: [PATCH] Update Item.php --- app/Item.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/Item.php b/app/Item.php index 09c61821..0e8dfd53 100644 --- a/app/Item.php +++ b/app/Item.php @@ -165,18 +165,11 @@ class Item extends Model public function getLinkTargetAttribute() { - if((int)$this->type === 1) { + $target = Setting::fetch('window_target'); + + if((int)$this->type === 1 || $target === 'current') { return ''; } else { - $settings = Setting::all(); - foreach($settings as $key => $val) { - if($val['key'] === 'window_target') { - $target = $val['value']; - if($target === 'current') { - $target = ''; - } - } - } return ' target="' . $target . '"'; } }