v2 first commit
This commit is contained in:
@ -15,19 +15,14 @@ class Company extends TransformerAbstract
|
||||
{
|
||||
return [
|
||||
'id' => $model->id,
|
||||
'name' => $model->company_name,
|
||||
'email' => $model->company_email,
|
||||
'name' => $model->name,
|
||||
'email' => $model->email,
|
||||
'domain' => $model->domain,
|
||||
'address' => $model->company_address,
|
||||
'logo' => $model->company_logo,
|
||||
'default_account' => $model->default_account,
|
||||
'default_currency' => $model->default_currency,
|
||||
'default_tax' => $model->default_tax,
|
||||
'default_payment_method' => $model->default_payment_method,
|
||||
'default_language' => $model->default_language,
|
||||
'address' => $model->address,
|
||||
'logo' => $model->logo,
|
||||
'enabled' => $model->enabled,
|
||||
'created_at' => $model->created_at->toIso8601String(),
|
||||
'updated_at' => $model->updated_at->toIso8601String(),
|
||||
'created_at' => $model->created_at ? $model->created_at->toIso8601String() : '',
|
||||
'updated_at' => $model->updated_at ? $model->updated_at->toIso8601String() : '',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
34
app/Transformers/Common/Contact.php
Normal file
34
app/Transformers/Common/Contact.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Transformers\Common;
|
||||
|
||||
use App\Models\Common\Contact as Model;
|
||||
use League\Fractal\TransformerAbstract;
|
||||
|
||||
class Contact extends TransformerAbstract
|
||||
{
|
||||
/**
|
||||
* @param Model $model
|
||||
* @return array
|
||||
*/
|
||||
public function transform(Model $model)
|
||||
{
|
||||
return [
|
||||
'id' => $model->id,
|
||||
'company_id' => $model->company_id,
|
||||
'user_id' => $model->user_id,
|
||||
'type' => $model->type,
|
||||
'name' => $model->name,
|
||||
'email' => $model->email,
|
||||
'tax_number' => $model->tax_number,
|
||||
'phone' => $model->phone,
|
||||
'address' => $model->address,
|
||||
'website' => $model->website,
|
||||
'currency_code' => $model->currency_code,
|
||||
'enabled' => $model->enabled,
|
||||
'reference' => $model->reference,
|
||||
'created_at' => $model->created_at ? $model->created_at->toIso8601String() : '',
|
||||
'updated_at' => $model->updated_at ? $model->updated_at->toIso8601String() : '',
|
||||
];
|
||||
}
|
||||
}
|
@ -24,17 +24,15 @@ class Item extends TransformerAbstract
|
||||
'id' => $model->id,
|
||||
'company_id' => $model->company_id,
|
||||
'name' => $model->name,
|
||||
'sku' => $model->sku,
|
||||
'description' => $model->description,
|
||||
'sale_price' => $model->sale_price,
|
||||
'purchase_price' => $model->purchase_price,
|
||||
'quantity' => $model->quantity,
|
||||
'category_id' => $model->category_id,
|
||||
'tax_id' => $model->tax_id,
|
||||
'picture' => $model->picture,
|
||||
'enabled' => $model->enabled,
|
||||
'created_at' => $model->created_at->toIso8601String(),
|
||||
'updated_at' => $model->updated_at->toIso8601String(),
|
||||
'created_at' => $model->created_at ? $model->created_at->toIso8601String() : '',
|
||||
'updated_at' => $model->updated_at ? $model->updated_at->toIso8601String() : '',
|
||||
];
|
||||
}
|
||||
|
||||
|
32
app/Transformers/Common/Report.php
Normal file
32
app/Transformers/Common/Report.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Transformers\Common;
|
||||
|
||||
use App\Models\Common\Report as Model;
|
||||
use League\Fractal\TransformerAbstract;
|
||||
|
||||
class Report extends TransformerAbstract
|
||||
{
|
||||
/**
|
||||
* @param Model $model
|
||||
* @return array
|
||||
*/
|
||||
public function transform(Model $model)
|
||||
{
|
||||
return [
|
||||
'id' => $model->id,
|
||||
'company_id' => $model->company_id,
|
||||
'name' => $model->name,
|
||||
'alias' => $model->alias,
|
||||
'description' => $model->description,
|
||||
'type' => $model->type,
|
||||
'group' => $model->group,
|
||||
'period' => $model->period,
|
||||
'basis' => $model->basis,
|
||||
'graph' => $model->graph,
|
||||
'enabled' => $model->enabled,
|
||||
'created_at' => $model->created_at ? $model->created_at->toIso8601String() : '',
|
||||
'updated_at' => $model->updated_at ? $model->updated_at->toIso8601String() : '',
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user