Skip to content

Commit

Permalink
fixed item tax in api
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Jan 2, 2021
1 parent 4612f6b commit b060480
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/Common/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Items extends ApiController
*/
public function index()
{
$items = Item::with('category', 'tax')->collect();
$items = Item::with('category', 'taxes')->collect();

return $this->response->paginator($items, new Transformer());
}
Expand Down
2 changes: 1 addition & 1 deletion app/Transformers/Common/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function includeTaxes(Model $model)
return $this->null();
}

return $this->item($model->taxes, new Tax());
return $this->collection($model->taxes, new Tax());
}

/**
Expand Down

0 comments on commit b060480

Please sign in to comment.