Category
is a functional representation of the category endpoints
from the API.
The list and details actions are supported.
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();
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.