diff --git a/app/TwoFAccount.php b/app/TwoFAccount.php index fa9f95cc..fd95b110 100644 --- a/app/TwoFAccount.php +++ b/app/TwoFAccount.php @@ -3,6 +3,7 @@ namespace App; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Facades\Storage; class TwoFAccount extends Model { @@ -16,4 +17,22 @@ class TwoFAccount extends Model * @var string */ protected $table = 'twofaccounts'; + + + /** + * Null empty icon resource has gone + * + * @param string $value + * @return string + */ + public function getIconAttribute($value) + { + + if( !Storage::exists('public/' . pathinfo($value)['basename']) ) { + + return ''; + } + + return $value; + } } diff --git a/resources/js/components/TwofaccountShow.vue b/resources/js/components/TwofaccountShow.vue index 81847fad..9445ded3 100644 --- a/resources/js/components/TwofaccountShow.vue +++ b/resources/js/components/TwofaccountShow.vue @@ -1,6 +1,6 @@