mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 12:34:35 -04:00
Fixes for transformers
This commit is contained in:
parent
9afcc28549
commit
3b6fa39d43
@ -15,7 +15,6 @@ use App\Models\CompanyGateway;
|
|||||||
|
|
||||||
class CompanyGatewayFactory
|
class CompanyGatewayFactory
|
||||||
{
|
{
|
||||||
use MakesHash;
|
|
||||||
|
|
||||||
public static function create(int $company_id, int $user_id) :CompanyGateway
|
public static function create(int $company_id, int $user_id) :CompanyGateway
|
||||||
{
|
{
|
||||||
@ -23,7 +22,7 @@ class CompanyGatewayFactory
|
|||||||
$company_gateway = new CompanyGateway;
|
$company_gateway = new CompanyGateway;
|
||||||
$company_gateway->company_id = $company_id;
|
$company_gateway->company_id = $company_id;
|
||||||
$company_gateway->user_id = $user_id;
|
$company_gateway->user_id = $user_id;
|
||||||
|
|
||||||
return $company_gateway;
|
return $company_gateway;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@ class UpdateCompanyRequest extends Request
|
|||||||
|
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
\Log::error($this->all());
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'logo' => 'mimes:jpeg,jpg,png,gif|max:10000', // max 10000kb
|
'logo' => 'mimes:jpeg,jpg,png,gif|max:10000', // max 10000kb
|
||||||
|
@ -64,25 +64,25 @@ class CompanyTransformer extends EntityTransformer
|
|||||||
public function transform(Company $company)
|
public function transform(Company $company)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'id' => $this->encodePrimaryKey($company->id),
|
'id' => (string)$this->encodePrimaryKey($company->id),
|
||||||
'name' => $company->name ?: '',
|
'name' => (string)$company->name ?: '',
|
||||||
'logo' => $company->getLogo(),
|
'logo_url' => (string)$company->getLogo(),
|
||||||
'company_key' => $company->company_key ?: '',
|
'company_key' => (string)$company->company_key ?: '',
|
||||||
'address1' => $company->address1 ?: '',
|
'address1' => (string)$company->address1 ?: '',
|
||||||
'address2' => $company->address2 ?: '',
|
'address2' => (string)$company->address2 ?: '',
|
||||||
'city' => $company->city ?: '',
|
'city' => (string)$company->city ?: '',
|
||||||
'state' => $company->state ?: '',
|
'state' => (string)$company->state ?: '',
|
||||||
'postal_code' => $company->postal_code ?: '',
|
'postal_code' => (string)$company->postal_code ?: '',
|
||||||
'work_phone' => $company->work_phone ?: '',
|
'work_phone' => (string)$company->work_phone ?: '',
|
||||||
'work_email' => $company->work_email ?: '',
|
'work_email' => (string)$company->work_email ?: '',
|
||||||
'country_id' => (string) $company->country_id ?: '',
|
'country_id' => (string) $company->country_id ?: '',
|
||||||
'vat_number' => $company->vat_number ?: '',
|
'vat_number' => (string)$company->vat_number ?: '',
|
||||||
'id_number' => $company->id_number ?: '',
|
'id_number' => (string)$company->id_number ?: '',
|
||||||
'size_id' => (string) $company->size_id ?: '',
|
'size_id' => (string) $company->size_id ?: '',
|
||||||
'industry_id' => (string) $company->industry_id ?: '',
|
'industry_id' => (string) $company->industry_id ?: '',
|
||||||
'settings' => $company->settings ?: '',
|
'settings' => $company->settings ?: '',
|
||||||
'updated_at' => $company->updated_at,
|
'updated_at' => (int)$company->updated_at,
|
||||||
'deleted_at' => $company->deleted_at,
|
'deleted_at' => (int)$company->deleted_at,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user