Warning:
You are viewing the Feeds v2 documentation. Feeds v2 is in maintenance mode and no longer receives new features. New projects should use Feeds v3, a major upgrade in performance, capabilities, and developer experience. To move an existing app, follow the migration guide.

Enrichment

Enrichment of Collection Entries

Objects stored inside collections can be embedded inside activities or user objects. This allows you to integrate with Stream without building a complex integration with another database. Stream's collections can be used as your data source for data enrichment.

// first we add our object to the food collection
$client->collections()->add(
   "food", ["name" => "Cheese Burger", "rating" => "4 stars"], "cheese-burger"
);

// then we embed a reference to the entry we created before
$user_feed->addActivity(
  ["actor" => "jim", "verb" => "grill",
   "object" => $client->collections()->createReference("food", "cheese-burger")]
);

// if we now read the feed, the activity we just added will include the entire full object
$user_feed->getActivities(0, 1, null, true);
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Feeds PHP v2: <Your Question>