# Storyfeed
> Storyfeed is an activity-feed package for Laravel: timeline and aggregated
> reads from one payload contract, with W3C Activity Streams 2.0 at the
> serialization boundary. Pre-1.0 — the API can change without a deprecation
> cycle.
>
> Generated from the docs source. Pages embed live Vue components that render
> real payloads through the real renderer; those cannot be carried in plain
> text and appear here as bracketed markers naming what is missing and where to
> see it.
## Getting-started
- [Introduction](https://docs.storyfeed.dev/getting-started/introduction.md): Storyfeed provides activity feeds for Laravel. You record activities and display them as a live feed or a log. Storyfeed also serializes activities as W3C Activity Streams 2.0 docu
- [Installation](https://docs.storyfeed.dev/getting-started/installation.md): Install Storyfeed and create the tables that store your activities.
- [Quickstart](https://docs.storyfeed.dev/getting-started/quickstart.md): Record an activity and display it with the Blade kit. Prepare the models, define a headline, and publish the activity from your application. This example records a customer placing
- [What You Can Build](https://docs.storyfeed.dev/getting-started/what-you-can-build.md):
## Basics
- [Feedable Models](https://docs.storyfeed.dev/basics/feedable-models.md): A feedable model provides a label for its activities. Storyfeed supplies a default label; links and images are optional.
- [Recording Activities](https://docs.storyfeed.dev/basics/recording-activities.md): An activity records a verb and its participants. Storyfeed is a side effect, never the source: in application code, publish from your own domain events that implement Storyfeed\Con
- [The Feed File](https://docs.storyfeed.dev/basics/the-feed-file.md): Define activity headlines, icons, and group headlines in routes/feed.php. The installer creates this file.
- [Story Classes](https://docs.storyfeed.dev/basics/story-classes.md): A Story class groups a model's verb definitions in one file. Each public verb method defines what an activity says in the feed, in place of an inline definition in routes/feed.php.
- [Constraining Roles](https://docs.storyfeed.dev/basics/constraining-roles.md): Role constraints limit which model types may fill an activity's roles. A headline written for a shop target may not describe another type correctly. Use a constraint to reject that
- [Named Stories](https://docs.storyfeed.dev/basics/named-stories.md): A named story lets you publish using a registered declaration name. The name selects the verb and checks the object's type, so a misspelling or wrong object type throws an exceptio
- [Activity Verbs](https://docs.storyfeed.dev/basics/activity-verbs.md): A verb names the action in base form, such as place or email. The object type is stored separately, so use place rather than order.place or place_order. See Choosing a Verb for exa
- [Activity Content](https://docs.storyfeed.dev/basics/activity-content.md): A body adds structured content beneath an entity’s label: a quote, a photo, a few labelled values. Choose a body from the evidence you have:
- [Feed Media](https://docs.storyfeed.dev/basics/feed-media.md): A model's toFeed() method describes what is stored. Its static feedMedia() method resolves links and media when a feed is retrieved:
## Retrieving
- [Retrieving Feeds](https://docs.storyfeed.dev/retrieving/retrieving-feeds.md):
- [Composing Feeds](https://docs.storyfeed.dev/retrieving/composing-feeds.md): Compose and render any feed-shaped data you already have: a project showcase, your talks, the steps an order went through. Storyfeed reads it into the same payload as a recorded fe
- [Named Feeds](https://docs.storyfeed.dev/retrieving/named-feeds.md): A named feed defines an audience once: its verbs, its mode and its link targets. Every screen that retrieves the 'kitchen' feed applies the same definition. A feed class that takes
- [Feed Sources](https://docs.storyfeed.dev/retrieving/feed-sources.md): A source is where a feed reads its items: the database by default, or an array, a config entry, or an API. A source's items read into the same payload as recorded activities, ready
## Ui
- [Installing the Kits](https://docs.storyfeed.dev/ui/installing-the-kits.md): Storyfeed UI renders a page of activities with Blade, Vue or React components. Install the package, then choose the kit your application uses.
- [Blade](https://docs.storyfeed.dev/ui/blade.md): The Blade kit renders a feed page with one component. Install storyfeed/ui, scan its Tailwind utilities and register the Typography plugin.
- [Vue](https://docs.storyfeed.dev/ui/vue.md): The Vue kit renders Storyfeed's serialized items with Vue 3 components. Copy it into your app and pass a feed page to FeedStream.
- [React](https://docs.storyfeed.dev/ui/react.md): The React kit renders Storyfeed's serialized items with React 19 components. Copy it into your app, wrap the feed in FeedProvider, and pass a feed page to FeedStream.
- [Customizing the Kits](https://docs.storyfeed.dev/ui/customizing-the-kits.md):
- [Building Your Own Components](https://docs.storyfeed.dev/ui/building-your-own-components.md):
- [Blade Components](https://docs.storyfeed.dev/ui/reference/blade-components.md): Every component the Blade kit registers, with its attributes and slots. Each one is an anonymous component in the storyfeed:: namespace, so it renders on its own as well as inside
- [Vue Components](https://docs.storyfeed.dev/ui/reference/vue-components.md): Every component the Vue kit copies into your app, with its props, slots and events, and the injection keys it reads. Paths are relative to the kit's directory, resources/js/compone
- [React Components](https://docs.storyfeed.dev/ui/reference/react-components.md): Every component the React kit exports, with its props and render props, and the options FeedProvider takes. Import them from the kit's directory, @/components/storyfeed by default.
- [Pages, Rails and Styles](https://docs.storyfeed.dev/ui/reference/pages-rails-and-styles.md): The values all three kits share: the page shapes they read, the rails, the group states and the CSS variables. The attribute and prop names are on Blade Components, Vue Components
## Cookbook
- [Choosing When to Publish](https://docs.storyfeed.dev/cookbook/choosing-when-to-publish.md): Storyfeed is a side effect, never the source. Your own domain events are the source of truth, and the feed is one subscriber to them: dispatch an app event where the transition suc
- [Composing a Coherent Activity](https://docs.storyfeed.dev/cookbook/composing-a-coherent-activity.md): A developer adds a new kind of activity, for example a clause rewritten in an agreement. They pick a verb, an object and a headline, and the feed shows it. Weeks later, the headlin
- [Recording Value Changes](https://docs.storyfeed.dev/cookbook/recording-value-changes.md): A manager renames the "Summer" menu to "Late Summer". The feed should say "renamed Summer to Late Summer". Passing the two names as roles makes each name a participant, so a search
- [Choosing a Verb](https://docs.storyfeed.dev/cookbook/choosing-a-verb.md): A team adds activities to an app one feature at a time. One developer records create for a new order, another records order_placed, and a third records update for every change to a
- [Choosing to Record or Compose](https://docs.storyfeed.dev/cookbook/choosing-to-record-or-compose.md): A menu item's page should show its price history, and the shop's feed should show what staff did today. The app already keeps a price_changes table. Recording every price change as
- [Recording Deletions](https://docs.storyfeed.dev/cookbook/recording-deletions.md): A manager deletes a menu item that was ordered for months. The menu item's activities still matter: the shop's history should keep showing what was sold and when. If the model is g
- [Activities Without an Actor](https://docs.storyfeed.dev/cookbook/activities-without-an-actor.md): A restaurant's app records what people do, but some things happen with no person behind them. A nightly job closes the day's orders, a payment provider confirms a charge, and someo
- [Recording Email Lifecycle Events](https://docs.storyfeed.dev/cookbook/recording-email-lifecycle-events.md): An app emails an invoice to a customer. The email is sent, delivered, maybe opened, and sometimes bounced or reported as spam. Someone looking at the invoice wants to see whether i
- [Keeping a Pulse Per Record](https://docs.storyfeed.dev/cookbook/keeping-a-pulse-per-record.md): An agency shares a proposal with a client through a link. The client opens it on Monday, again on Tuesday with a colleague, then downloads the PDF. Each open is a request, and each
- [Recording an Authoriser](https://docs.storyfeed.dev/cookbook/recording-an-authoriser.md): A junior chef changes the menu, and the head chef approves it before it goes live. The feed should credit the junior chef with the change. The owner still needs to answer who appro
- [Recording Connected App Writes](https://docs.storyfeed.dev/cookbook/recording-connected-app-writes.md): An operator asks an AI assistant, connected to the app, to update a supplier's prices. The assistant makes the change through the app's API. The feed should say who asked for the c
- [Choosing What to Group](https://docs.storyfeed.dev/cookbook/choosing-what-to-group.md): A busy restaurant records dozens of activities an hour: orders placed, menus edited, dishes marked sold out. A manager scanning the feed wants the overview, such as who was busy an
- [Headlines for Grouped Activities](https://docs.storyfeed.dev/cookbook/headlines-for-grouped-activities.md): A customer places an order, changes it, and places it again. The feed groups the placements, and a headline such as "placed 3 orders" tells the owner there are three orders when th
- [Naming Group Members From Activity Data](https://docs.storyfeed.dev/cookbook/naming-group-members-from-activity-data.md): A lawyer rewrites five clauses of one agreement in an afternoon. The clauses are not models, so each activity's object is the agreement, and its clause name is in the activity's da
- [Computed Values in the Feed](https://docs.storyfeed.dev/cookbook/computed-values-in-the-feed.md): A menu item's activity says how many times the dish has been ordered. Orders keep arriving after the activity was recorded, but the menu item itself is never saved again. A count s
## Recording
- [Parties & Anonymous Actors](https://docs.storyfeed.dev/recording/parties-and-anonymous-actors.md): An activity's actor can be a user or a party, such as a payment provider. An anonymous activity has no recorded actor.
- [Publishing From Events](https://docs.storyfeed.dev/recording/publishing-from-events.md): Storyfeed is a side effect, never the source. Dispatch your own domain event where the transition succeeds and have it implement Storyfeed\Contracts\PublishesToFeed; core's listene
- [Publishing Story Classes](https://docs.storyfeed.dev/recording/publishing-story-classes.md): A Story class that extends Storyfeed\Stories\Story builds one activity with its data and publishes it.
- [Containers & Context](https://docs.storyfeed.dev/recording/containers-and-context.md): The context role records where an activity happened, such as the shop a dish belongs to. Use it to retrieve activities within that shop.
- [Distant Relations](https://docs.storyfeed.dev/recording/distant-relations.md): Like Eloquent's hasManyThrough, a feed can reach distant relations. A dish belongs to a menu, the menu to a shop, and the shop to a mall. Use involving($mall) to retrieve activity
- [Casting Activity Data](https://docs.storyfeed.dev/recording/casting-activity-data.md): An activity's data is stored as JSON, so a headline closure reads it back as strings, numbers and arrays. Casts turn those values back into the types your application uses: enums,
- [Activity Scopes](https://docs.storyfeed.dev/recording/activity-scopes.md): Storyfeed::actor() and Storyfeed::context() supply a default actor or context to every activity published inside a callback. HTTP middleware can supply either role for a whole requ
- [Story Middleware](https://docs.storyfeed.dev/recording/story-middleware.md): Use story middleware to add shared data, supply roles, or decide whether to publish an activity. The built-in batch middleware collects one actor's activities into a batch; see Bat
- [Queued Publishing](https://docs.storyfeed.dev/recording/queued-publishing.md): queue() sends an activity to a Laravel queue for a worker to publish. publish() writes it in the current process.
## Shaping
- [Aggregation](https://docs.storyfeed.dev/shaping/aggregation.md): Aggregation combines related activities into one feed item, so three orders from one customer appear as one row. See Choosing What to Group to decide when that helps the reader.
- [Live Burst Windows](https://docs.storyfeed.dev/shaping/live-burst-windows.md): Live combines the same action while activity continues. A quiet gap or a maximum duration closes the row; the next activity starts another burst.
- [Batching Activities](https://docs.storyfeed.dev/shaping/batching-activities.md): A batch collects one actor's activities while they keep arriving. Batches don't change the feed's rows themselves: when a batch closes, its runs of bundleable activities become a c
- [Custom Axes](https://docs.storyfeed.dev/shaping/custom-axes.md): Group activities by shared fields and choose which custom group takes priority.
- [Keeping the Latest Activity](https://docs.storyfeed.dev/shaping/keeping-the-latest-activity.md): keepLatest() keeps the latest matching activity in the feed and removes earlier ones, including from log().
- [Composites](https://docs.storyfeed.dev/shaping/composites.md): A composite is one activity whose object is a collection, such as several tasks completed together.
- [Resolving Bodies When Retrieved](https://docs.storyfeed.dev/shaping/resolving-bodies-when-retrieved.md): A body built in feedMedia() shows the model’s current values instead of the stored snapshot.
- [Custom Body Types](https://docs.storyfeed.dev/shaping/custom-body-types.md): Use a custom component to render application-specific props, or define a versioned body type when you need to upgrade its stored payload over time.
- [Localization](https://docs.storyfeed.dev/shaping/localization.md): Headlines and nouns may use translation keys from your app's lang files. Storyfeed translates them when retrieving the feed, using the application's current locale. Set it for each
- [Activity Streams 2.0](https://docs.storyfeed.dev/shaping/activity-streams.md): Storyfeed can serve each activity as a W3C Activity Streams 2.0 JSON-LD document, using AS2 names for every role.
## Maintenance
- [Testing](https://docs.storyfeed.dev/maintenance/testing.md): Storyfeed::fake() captures activities instead of saving them, so you can assert what your application publishes. Coverage assertions check that your recorded activities and possibl
- [Updating Dependencies](https://docs.storyfeed.dev/maintenance/updating-dependencies.md): Update the packages you intend to change, inspect what Composer resolved, and run your application's checks before committing the lock file. Start with a clean working tree so the
- [Diagnosing Your Feed](https://docs.storyfeed.dev/maintenance/diagnosing-your-feed.md): The doctor checks your definitions, schema, and recorded activities and reports how to fix gaps. In local and testing environments, an unregistered verb throws UnknownVerb by defau
- [Deleted Models](https://docs.storyfeed.dev/maintenance/deleted-models.md): Activities remain in the feed when a model is deleted. Storyfeed replaces the model with a tombstone, which identifies its former type and deletion time without keeping its details
- [Retention](https://docs.storyfeed.dev/maintenance/retention.md): Set retention per verb to control how long activities remain in the feed. storyfeed:prune permanently deletes expired activities and entity details no remaining activity uses.
- [Healing a Feed](https://docs.storyfeed.dev/maintenance/healing-a-feed.md): A healer selects activities whose source has been permanently deleted, such as a file that no longer exists. The storyfeed:heal command soft-deletes the selected activities. Healin
## Project
- [Versioning and Support](https://docs.storyfeed.dev/project/versioning-and-support.md): From 1.0.0, Storyfeed follows Semantic Versioning. This page says what semver covers here, what counts as a breaking change, and how long each release line is supported.
- [The MIT Pledge](https://docs.storyfeed.dev/project/mit-pledge.md): Everything Storyfeed publishes under the MIT license stays MIT.
## Packages
- [Package Integration](https://docs.storyfeed.dev/packages/package-integration.md): Ship activity definitions from your Laravel package's service provider. Applications can use them without creating a feed file.
## Reference
- [Configuration](https://docs.storyfeed.dev/reference/configuration.md): All keys in config/storyfeed.php have defaults.
- [Commands](https://docs.storyfeed.dev/reference/commands.md): Artisan commands install, inspect and maintain the feed.
- [Doctor Checks](https://docs.storyfeed.dev/reference/doctor-checks.md): See Diagnosing Your Feed for running the doctor and fixing findings.
- [Feedable API](https://docs.storyfeed.dev/reference/feedable-api.md): The Feedable API defines model snapshots and resolves current links and media. See Feedable Models for setup.
- [FeedItem API](https://docs.storyfeed.dev/reference/feed-item-api.md): Storyfeed\Support\FeedItem, Headline, and Entity provide named methods for accessing the payload without changing it. See Building Your Own Components for examples.
- [Entry API](https://docs.storyfeed.dev/reference/entry-api.md): Storyfeed::compose() builds a feed from entries, and a source's items() returns them. Storyfeed\Sources\Entry is one entry, in three forms: fluent, named arguments, or an array. Se
- [Verb Vocabulary](https://docs.storyfeed.dev/reference/verb-vocabulary.md): Storyfeed\Act provides common verbs as backed enum cases. Each stores an English verb, such as accept, and maps it to an Activity Streams 2.0 type, such as Accept.
- [The Payload Contract](https://docs.storyfeed.dev/reference/payload-contract.md): Payload v1 is stable. This page defines its node contract for renderers.
- [Schema](https://docs.storyfeed.dev/reference/schema.md): Storyfeed's migrations create ten tables. Publish them with storyfeed:install or the following command:
- [Storage Architecture](https://docs.storyfeed.dev/reference/storage-architecture.md): Storyfeed stores each activity once, in feed_activities, and writes the supporting rows used to retrieve it efficiently at publication: the entities' labels, the groups the activit
- [Glossary](https://docs.storyfeed.dev/reference/glossary.md): Terms used to define, publish, retrieve, and render an activity feed.
## Optional
- [Full documentation, single file](https://docs.storyfeed.dev/llms-full.txt)