mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Change the way company logos are stored in the settings
This commit is contained in:
parent
fb847dba69
commit
fe457537b6
@ -36,7 +36,7 @@ class CompanyPresenter extends EntityPresenter
|
|||||||
$settings = $this->entity->settings;
|
$settings = $this->entity->settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (strlen($settings->company_logo) > 0) ? $settings->company_logo : 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png';
|
return (strlen($settings->company_logo) > 0) ? url($settings->company_logo) : 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function address($settings = null)
|
public function address($settings = null)
|
||||||
|
@ -22,14 +22,9 @@ trait Uploadable
|
|||||||
{
|
{
|
||||||
public function removeLogo($company)
|
public function removeLogo($company)
|
||||||
{
|
{
|
||||||
$company_logo = $company->settings->company_logo;
|
|
||||||
|
|
||||||
$file_name = basename($company_logo);
|
if (Storage::exists($company->settings->company_logo)) {
|
||||||
|
UnlinkFile::dispatchNow(config('filesystems.default'), $company->settings->company_logo);
|
||||||
$storage_path = $company->company_key . '/' . $file_name;
|
|
||||||
|
|
||||||
if (Storage::exists($storage_path)) {
|
|
||||||
UnlinkFile::dispatchNow(config('filesystems.default'), $storage_path);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,6 +33,8 @@ trait Uploadable
|
|||||||
if ($file) {
|
if ($file) {
|
||||||
$path = UploadAvatar::dispatchNow($file, $company->company_key);
|
$path = UploadAvatar::dispatchNow($file, $company->company_key);
|
||||||
|
|
||||||
|
$path = str_replace(config("ninja.app_url"), "", $path);
|
||||||
|
|
||||||
info("the path {$path}");
|
info("the path {$path}");
|
||||||
|
|
||||||
if ($path) {
|
if ($path) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user