Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 1.1 KB

categories.md

File metadata and controls

65 lines (46 loc) · 1.1 KB



Category Entity



Optimus\Entities\Category



Category is a functional representation of the category endpoints from the API.

Table of contents



Actions

The list and details actions are supported.



Methods
products

The category entity, once loaded, has a products method. This can be used to load all products for the current category.

$all = Categories::all();
$first = $all[0];

$products = $first->products();


Mutations
subcategories

When viewing the details of a given category it will sometimes have subcategories. Rather than just returning an array of data each subcategory become mutated into an object.

The Optimus\Entities\Subcategory object simply extends the category object.