2015-11-19 12:50:35 +01:00
|
|
|
<?php namespace App\Ninja\Transformers;
|
|
|
|
|
|
|
|
use App\Models\Product;
|
|
|
|
use League\Fractal;
|
|
|
|
|
|
|
|
class ProductTransformer extends EntityTransformer
|
|
|
|
{
|
|
|
|
public function transform(Product $product)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => (int) $product->public_id,
|
|
|
|
'product_key' => $product->product_key,
|
|
|
|
'notes' => $product->notes,
|
|
|
|
'cost' => $product->cost,
|
|
|
|
'qty' => $product->qty,
|
2015-12-15 12:03:01 +01:00
|
|
|
'account_key' =>$this->account->account_key,
|
|
|
|
'default_tax_rate_id' =>$product->default_tax_rate_id,
|
|
|
|
'updated_at' =>$product->updated_at,
|
2015-11-19 12:50:35 +01:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|