'Amarone', // The categoryid for 'red'. 'parent' => 3, 'details' => 'Italian Venoto region', 'attributes' => [ 'rich', 'aromatic', ], ]; $data['variety'][] = [ 'name' => 'Barbaresco', // The categoryid for 'red'. 'parent' => 3, 'details' => 'Italian Piedmont region', 'attributes' => [ 'smoky', 'earthy', ], ]; } if (strtolower($type) != 'red') { $data['variety'][] = [ 'name' => 'Kir', // The categoryid for 'white'. 'parent' => 1, 'details' => 'French Burgundy region', 'attributes' => [], ]; $data['variety'][] = [ 'name' => 'Pinot Grigio', // The categoryid for 'white'. 'parent' => 1, 'details' => 'From the northeast of Italy', 'attributes' => [ 'fruity', 'medium-bodied', 'slightly sweet', ], ]; } $response = new ResourceResponse($data, 200); return $response; } /** * {@inheritdoc} */ public function permissions() { // Remove permissions so the resource is available to all. return []; } }