Pre-1.0. Not intended for public use yet. The API is subject to undocumented change, and these pages may already be wrong about it.

Skip to content

Introduction ​

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 documents.

Activities ​

An activity records an action and the entities involved. Each entity has a role:

Erica Sinclair

The actor is who did it. The verb is what happened. The object is what it was done to, and the target is what it was aimed at.

Different Headlines for the Same Activity ​

You may change an activity's headline without changing its recorded verb or roles. Each example below uses the place verb:

Erica Sinclair (actor) sent (headline) Order #1035 (object) to Scoops Ahoy (target)

Erica Sinclair

A new order, Order #1035 (object), came in (headline) to Scoops Ahoy (target) from Erica Sinclair (actor)

Erica Sinclair
A new order, Order #1035, came in to Scoops Ahoy from Erica Sinclair

Scoops Ahoy (target) received (headline) Order #1035 (object) from Erica Sinclair (actor)

Erica Sinclair

Roles in Other Domains ​

Robin Buckley (actor) completed (verb) Crack the code (object) on the Scoops Troop board (target)

Robin Buckley
Crack the code

Work out what the Russian message on the tape is saying.

Steve Harrington (actor) signed (verb) the Scoops Ahoy employment contract (object)

Steve Harrington

scoops-ahoy-employment-contract.pdf PDF · 48 KB

Erica Sinclair (actor) joined (verb) the Scoops Troop (target)

Erica Sinclair

Recording Activities ​

Publish an activity where your application places the order:

Where the order is placed: a controller, an action, a listener
php
use Storyfeed\Facades\Storyfeed;

Storyfeed::activity()
    ->by($customer)
    ->action('place', $order)
    ->to($shop)
    ->publish();
php
use Storyfeed\Facades\Storyfeed;

Storyfeed::record(
    verb: 'place',
    object: $order,
    actor: $customer,
    target: $shop,
);
Erica Sinclair

Displaying Feeds ​

The same activities can be displayed in two modes:

Live ​

Live mode is the default. It groups the same action into one row until a quiet gap closes the burst. See Aggregation for which activities share a row.

Today

A
Alexei played a carnival game 3 times
Murray Bauman
JT
Jasper Tey went on 3 rides at the Fun Fair
JT
Jasper Tey checked in at the Fun Fair
Karen Wheeler
S
Stripe processed 3 payments

Yesterday

Robin Buckley
Find where the elevator goes

Find out where the elevator in the storeroom goes down to.

Saturday

DD
Doris Driscoll phoned the Hawkins Post about the rats
Dustin Henderson
Dustin Henderson
Dustin Henderson

Oct 28, 1984

Max Mayfield
Max Mayfield set a new high score on Dig Dug at the Palace Arcade

Log ​

Log mode displays each activity in a separate row.

Today

A
A
A
Murray Bauman
JT
JT
the carousel
the carousel
JT
JT
Jasper Tey checked in at the Fun Fair
Karen Wheeler
S
Stripe marked Scoops Ahoy invoice #1988 paid
Scoops Ahoy invoice #1988
Amount
$148.80
Billed to
Starcourt Mall
Reference
INV-1988
S
Stripe marked Scoops Ahoy invoice #1987 paid
Scoops Ahoy invoice #1987
Amount
$96.00
Billed to
Starcourt Mall
Reference
INV-1987
S
Stripe marked Scoops Ahoy invoice #1986 paid
Scoops Ahoy invoice #1986
Amount
$610.40
Billed to
Starcourt Mall
Reference
INV-1986

Yesterday

Robin Buckley
Find where the elevator goes

Find out where the elevator in the storeroom goes down to.

Saturday

DD
Doris Driscoll phoned the Hawkins Post about the rats
Dustin Henderson
Dustin Henderson
Dustin Henderson

Oct 28, 1984

Max Mayfield
Max Mayfield set a new high score on Dig Dug at the Palace Arcade

Released under the MIT License.