1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixes for company logo output

This commit is contained in:
David Bomba 2019-10-03 15:17:57 +10:00
parent 23265fb9e3
commit 9afcc28549
4 changed files with 11 additions and 2 deletions

View File

@ -33,6 +33,8 @@ class UpdateCompanyRequest extends Request
public function rules()
{
\Log::error($this->all());
return [
'logo' => 'mimes:jpeg,jpg,png,gif|max:10000', // max 10000kb
'industry_id' => 'integer|nullable',

View File

@ -186,6 +186,11 @@ class Company extends BaseModel
return isset($this->settings->language_id) && $this->language() ? $this->language()->locale : config('ninja.i18n.locale');
}
public function getLogo()
{
return $this->logo ? config('ninja.site_url').$this->logo : '';
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/

View File

@ -66,7 +66,7 @@ class CompanyTransformer extends EntityTransformer
return [
'id' => $this->encodePrimaryKey($company->id),
'name' => $company->name ?: '',
'logo' => $company->logo ?: '',
'logo' => $company->getLogo(),
'company_key' => $company->company_key ?: '',
'address1' => $company->address1 ?: '',
'address2' => $company->address2 ?: '',

View File

@ -83,8 +83,10 @@ class UploadLogoTest extends TestCase
])->put('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $data);
$response->assertStatus(302);
//$acc = $response->json();
//Log::error(print_r($response->json(),1));
//\Log::error(print_r($acc,1));
}