From 2b2cfbc2e501bf1f60db6b48dfe9a1726173c122 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 27 Sep 2016 20:34:43 +0300 Subject: [PATCH] Fix for #1084 --- app/Models/Account.php | 16 ++++++++++++++++ .../views/emails/partials/account_logo.blade.php | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/Models/Account.php b/app/Models/Account.php index 3819cea0b7e6..108bb8c14fe9 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -735,6 +735,22 @@ class Account extends Eloquent return Document::getDirectFileUrl($this->logo, $this->getLogoDisk()); } + public function getLogoPath() + { + if ( ! $this->hasLogo()){ + return null; + } + + $disk = $this->getLogoDisk(); + $adapter = $disk->getAdapter(); + + if ($adapter instanceof \League\Flysystem\Adapter\Local) { + return $adapter->applyPathPrefix($this->logo); + } else { + return Document::getDirectFileUrl($this->logo, $this->getLogoDisk()); + } + } + /** * @return mixed */ diff --git a/resources/views/emails/partials/account_logo.blade.php b/resources/views/emails/partials/account_logo.blade.php index a3a8ca167e07..c7f52e8c8ba2 100644 --- a/resources/views/emails/partials/account_logo.blade.php +++ b/resources/views/emails/partials/account_logo.blade.php @@ -3,7 +3,7 @@ @endif - + @if ($account->website)