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

Retrieving Feeds ​

Introduction ​

To retrieve a page of activities, call the feed method on the Storyfeed facade, followed by the get method.

Retrieving a Feed ​

You may return the feed from a route:

routes/web.php
php
use Illuminate\Support\Facades\Route;
use Storyfeed\Facades\Storyfeed;

Route::get('/', function () {
    return Storyfeed::feed()->limit(20)->get();
});

For three order placements, the response contains:

{
  "payload_version": 1,
  "items": [
    {
      "kind": "group",
      "id": "repeat-a-order-3",
      "axis": "repeat",
      "count": 3,
      "verb": "place",
      "published_at": "1985-07-02T12:02:00.000000Z",
      "headline_template": ":actor placed :count orders with :target",
      "headline": null,
      "glyph": "shopping-bag",
      "glyph_intent": "pending",
      "actor": {
        "type": "user",
        "id": "113",
        "label": "Erica Sinclair",
        "url": "/users/113",
        "attributes": {},
        "modal": false,
        "data": {},
        "media": null,
        "body": null,
        "tombstone": null
      },
      "object": null,
      "target": {
        "type": "venue",
        "id": "101",
        "label": "Scoops Ahoy",
        "url": "/venues/scoops",
        "attributes": {},
        "modal": false,
        "data": {},
        "media": {
          "icon": null,
          "image": null,
          "files": [],
          "preview": {
            "src": "/media/worlds/stranger-things/parlour.jpg",
            "mediaType": "image/jpeg",
            "width": 960,
            "height": 720,
            "alt": "An ice cream counter"
          },
          "url": null
        },
        "body": [
          {
            "$body": "Storyfeed/Body/Image",
            "$v": 1,
            "caption": "Scoops Ahoy",
            "alt": "Scoops Ahoy",
            "width": null,
            "height": null,
            "image": "preview"
          }
        ],
        "tombstone": null
      },
      "context": null,
      "origin": null,
      "result": null,
      "instrument": null,
      "sample": {
        "actors": [
          {
            "type": "user",
            "id": "113",
            "label": "Erica Sinclair",
            "url": "/users/113",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": null,
            "body": null,
            "tombstone": null
          }
        ],
        "objects": [
          {
            "type": "order",
            "id": "1041",
            "label": "Order #1041",
            "url": "/orders/1041",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": null,
            "body": null,
            "tombstone": null
          },
          {
            "type": "order",
            "id": "1040",
            "label": "Order #1040",
            "url": "/orders/1040",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": null,
            "body": null,
            "tombstone": null
          },
          {
            "type": "order",
            "id": "1035",
            "label": "Order #1035",
            "url": "/orders/1035",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": null,
            "body": null,
            "tombstone": null
          }
        ],
        "targets": [
          {
            "type": "venue",
            "id": "101",
            "label": "Scoops Ahoy",
            "url": "/venues/scoops",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": {
              "icon": null,
              "image": null,
              "files": [],
              "preview": {
                "src": "/media/worlds/stranger-things/parlour.jpg",
                "mediaType": "image/jpeg",
                "width": 960,
                "height": 720,
                "alt": "An ice cream counter"
              },
              "url": null
            },
            "body": [
              {
                "$body": "Storyfeed/Body/Image",
                "$v": 1,
                "caption": "Scoops Ahoy",
                "alt": "Scoops Ahoy",
                "width": null,
                "height": null,
                "image": "preview"
              }
            ],
            "tombstone": null
          }
        ],
        "contexts": [],
        "origins": [],
        "results": [],
        "instruments": []
      },
      "distinct": {
        "actors": 1,
        "objects": 3,
        "targets": 1,
        "contexts": 0,
        "origins": 0,
        "results": 0,
        "instruments": 0
      },
      "children": [
        {
          "kind": "activity",
          "id": "a-order-3",
          "verb": "place",
          "published_at": "1985-07-02T12:02:00.000000Z",
          "headline_template": ":actor placed :object with :target",
          "headline": null,
          "glyph": "shopping-bag",
          "glyph_intent": "pending",
          "actor": {
            "type": "user",
            "id": "113",
            "label": "Erica Sinclair",
            "url": "/users/113",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": null,
            "body": null,
            "tombstone": null
          },
          "object": {
            "type": "order",
            "id": "1041",
            "label": "Order #1041",
            "url": "/orders/1041",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": null,
            "body": null,
            "tombstone": null
          },
          "target": {
            "type": "venue",
            "id": "101",
            "label": "Scoops Ahoy",
            "url": "/venues/scoops",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": {
              "icon": null,
              "image": null,
              "files": [],
              "preview": {
                "src": "/media/worlds/stranger-things/parlour.jpg",
                "mediaType": "image/jpeg",
                "width": 960,
                "height": 720,
                "alt": "An ice cream counter"
              },
              "url": null
            },
            "body": [
              {
                "$body": "Storyfeed/Body/Image",
                "$v": 1,
                "caption": "Scoops Ahoy",
                "alt": "Scoops Ahoy",
                "width": null,
                "height": null,
                "image": "preview"
              }
            ],
            "tombstone": null
          },
          "context": null,
          "origin": null,
          "result": null,
          "instrument": null,
          "data": {},
          "tombstoned": [],
          "redundant": false,
          "missing_headline_template": null,
          "missing_headline": null
        },
        {
          "kind": "activity",
          "id": "a-order-2",
          "verb": "place",
          "published_at": "1985-07-02T12:01:00.000000Z",
          "headline_template": ":actor placed :object with :target",
          "headline": null,
          "glyph": "shopping-bag",
          "glyph_intent": "pending",
          "actor": {
            "type": "user",
            "id": "113",
            "label": "Erica Sinclair",
            "url": "/users/113",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": null,
            "body": null,
            "tombstone": null
          },
          "object": {
            "type": "order",
            "id": "1040",
            "label": "Order #1040",
            "url": "/orders/1040",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": null,
            "body": null,
            "tombstone": null
          },
          "target": {
            "type": "venue",
            "id": "101",
            "label": "Scoops Ahoy",
            "url": "/venues/scoops",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": {
              "icon": null,
              "image": null,
              "files": [],
              "preview": {
                "src": "/media/worlds/stranger-things/parlour.jpg",
                "mediaType": "image/jpeg",
                "width": 960,
                "height": 720,
                "alt": "An ice cream counter"
              },
              "url": null
            },
            "body": [
              {
                "$body": "Storyfeed/Body/Image",
                "$v": 1,
                "caption": "Scoops Ahoy",
                "alt": "Scoops Ahoy",
                "width": null,
                "height": null,
                "image": "preview"
              }
            ],
            "tombstone": null
          },
          "context": null,
          "origin": null,
          "result": null,
          "instrument": null,
          "data": {},
          "tombstoned": [],
          "redundant": false,
          "missing_headline_template": null,
          "missing_headline": null
        },
        {
          "kind": "activity",
          "id": "j84",
          "verb": "place",
          "published_at": "1985-07-02T12:00:00.000000Z",
          "headline_template": ":actor placed :object with :target",
          "headline": null,
          "glyph": "shopping-bag",
          "glyph_intent": "pending",
          "actor": {
            "type": "user",
            "id": "113",
            "label": "Erica Sinclair",
            "url": "/users/113",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": null,
            "body": null,
            "tombstone": null
          },
          "object": {
            "type": "order",
            "id": "1035",
            "label": "Order #1035",
            "url": "/orders/1035",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": null,
            "body": null,
            "tombstone": null
          },
          "target": {
            "type": "venue",
            "id": "101",
            "label": "Scoops Ahoy",
            "url": "/venues/scoops",
            "attributes": {},
            "modal": false,
            "data": {},
            "media": {
              "icon": null,
              "image": null,
              "files": [],
              "preview": {
                "src": "/media/worlds/stranger-things/parlour.jpg",
                "mediaType": "image/jpeg",
                "width": 960,
                "height": 720,
                "alt": "An ice cream counter"
              },
              "url": null
            },
            "body": [
              {
                "$body": "Storyfeed/Body/Image",
                "$v": 1,
                "caption": "Scoops Ahoy",
                "alt": "Scoops Ahoy",
                "width": null,
                "height": null,
                "image": "preview"
              }
            ],
            "tombstone": null
          },
          "context": null,
          "origin": null,
          "result": null,
          "instrument": null,
          "data": {},
          "tombstoned": [],
          "redundant": false,
          "missing_headline_template": null,
          "missing_headline": null
        }
      ],
      "children_truncated": false,
      "tombstoned": [],
      "redundant": false,
      "distinct_tombstoned": {
        "actors": 0,
        "objects": 0,
        "targets": 0,
        "contexts": 0,
        "origins": 0,
        "results": 0,
        "instruments": 0
      }
    }
  ],
  "next_cursor": "eyJwIjoiMjAyNi0wOC0xNFQxNDowNTowMFoifQ",
  "sync_token": "01J8Z3K4Q2V9WMX7R5T0B6N1CD"
}

The get method returns a FeedPage. Access its items with $page['items'] using PHP array syntax. The rendered feed displays:

ES
Erica Sinclair placed 3 orders with Scoops Ahoy

The three orders appear in one row. A group combines related activities, such as repeated orders by one customer, while retaining its members. See Aggregation for grouping rules and headlines.

Choosing a Read Mode ​

CallReturns
->live()groups of repeated actions or activities from several actors with the same target; the default
->summary()activities grouped by actor and calendar period, summarized by verb
->log()one item per activity, without groups

The following feeds display the same week of activities in each mode:

Live ​

Live mode groups repeated actions and activities from several actors with the same target. It is the default, so you may omit the live method.

A controller, or wherever the feed is read
php
use Storyfeed\Facades\Storyfeed;

Storyfeed::feed()->live()->get();

Today

DH
Dustin Henderson wrote Planck’s constant
Planck’s constant is 6.62607004.
Suzie, over Cerebro
RBSHES
MB
a hot dog
a hot dog
A
Alexei played a carnival game 3 times
JBJHA
Joyce Byers, Jim Hopper, Alexei and 4 more checked in at the Fun Fair
SH
Steve Harrington viewed 5 orders
KW
a bag of soft pretzels
a bag of soft pretzels
KW
Order #1042 items
2 moreOrder #1042
JT
Jasper Tey had a bite of a pretzel at the Fun Fair
a pretzel
a pretzel
LS
the fireworks
the fireworks
MMLSWB
Max Mayfield, Lucas Sinclair, Will Byers and 5 more checked in at the Hopper cabin
MB
Murray Bauman wrote Murray’s gate investigation
Murray’s gate investigation

What the machine needs

Alexei’s account: the machine is opening a gate beneath the mall.

  • Locate the control room.
  • Reach the two shutdown keys.
  • Check the safe combination before going in.

Working note: translation is evidence, not a complete floor plan.

Yesterday

RB
Find where the elevator goes

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

THBLJB
MB
Murray Bauman let the chief in at Murray's warehouse
N
Ned served Order #1036
SH
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
JB
Joyce Byers checked in at the Hess farm
JH
Jim Hopper checked in at the Hess farm

Tuesday

ES
Erica Sinclair completed 2 tasks on the Scoops Troop board
WBMMLS
ESMMLS
Erica Sinclair, Max Mayfield, Lucas Sinclair and 2 more ordered from Scoops Ahoy
SH
Steve Harrington marked 2 orders ready
SH
Steve Harrington confirmed 4 orders
SH
Steve Harrington confirmed Order #1035 2 times
ESRBSH
ES
Erica Sinclair replied about Is that free for life, or only for today?
SH
ES
ES
Erica Sinclair sent a note about Order #1035
ES
Erica Sinclair saved Order #2031 2 times
SH
Steve Harrington changed the price of USS Butterscotch
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
SH
Steve Harrington added a photo of USS Butterscotch
USS Butterscotch
USS Butterscotch
TH
SH
Steve Harrington put USS Butterscotch on the menu
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
JB
Joyce Byers checked in at Hawkins Town Hall
JH
Jim Hopper checked in at Hawkins Town Hall
SH
2 activities

Starcourt Mall visitor guide

The visitor guide includes entrances, parking and shop locations.

Scoops Ahoy opening hours

The counter opens at 10 am. Orders are available until 9 pm.

Monday

JH
Jim Hopper checked in at Hawkins Lab
JB
Joyce Byers checked in at Hawkins Lab
JB
A fairground at night
A fairground at night
JT
Jasper Tey merged 2 pull requests into cerebro
ESRBDH
RB
Map the code to the mall

Match each line of the message to a place in the mall.

SC
Ticket #101

Every magnet on the store display fell off at once, then did it again an hour later.

E

Sunday

SH
Match the music to the mall

Pick out the mall in the sounds behind the message on the tape.

RB
Crack the code

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

JH
Jim Hopper checked in at Enzo's
JH
Jim Hopper booked a table at Enzo's
JH
Jim Hopper checked in at Hawkins Town Hall
MM
Max Mayfield checked in at Starcourt Mall
E
Eleven checked in at Starcourt Mall
DH
Dustin Henderson checked in at Scoops Ahoy
JB
Jonathan Byers uploaded 4 photos to the Hawkins Post
Rolled newspapersA room lit redArcade machines in a dark room
TH
They came back every night for my fertilizer, bag after bag
Doris Driscoll
NW
They came back every night for my fertilizer, bag after bag
Doris Driscoll
SH
Steve Harrington changed the price of USS Butterscotch
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
SH
Steve Harrington added a menu item, USS Butterscotch
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
JB
Ticket #101

Every magnet on the store display fell off at once, then did it again an hour later.

JB
Ticket #101

Every magnet on the store display fell off at once, then did it again an hour later.

Saturday

DD
Doris Driscoll phoned the Hawkins Post about the rats
DH
Dustin Henderson wrote Cerebro reception log
Cerebro reception log
STATION: CEREBRO / WEATHERTOP
CALL TO UTAH .......... NO REPLY
UNEXPECTED SIGNAL .... VOICE / RUSSIAN
MESSAGE .............. REPEATING
NEXT STEP ............ KEEP THE TAPE
DH
Record the broadcast

Tape the Russian message Cerebro picked up on Weathertop.

DH
Dustin Henderson radioed Suzie 3 times
MMLSWB
Max Mayfield, Lucas Sinclair, Will Byers and 2 more checked in at Weathertop
JT
Jasper Tey starred cerebro
cerebro
About
The radio built at camp, to reach Utah from Weathertop
Visibility
Public
DH
Dustin Henderson came home to the Party

Friday

JB
Ticket #102

The power went out across town this evening. It came back on its own a minute later.

MMLSMW
RB
SH
Steve Harrington served 2 orders
JT
Jasper Tey merged 3 pull requests into cerebro
DH
cerebro
About
The radio built at camp, to reach Utah from Weathertop
Visibility
Public

Summary ​

Summary mode groups activities by actor and day, with phrases such as "placed 3 orders, asked about a product and paid". Actors with the same single activity may share a row. See Summary Rows for the payload fields.

A controller, or wherever the feed is read
php
use Storyfeed\Facades\Storyfeed;

Storyfeed::feed()->summary()->get();

Today

DH
Dustin Henderson checked in at Starcourt Mall and wrote Planck’s constant
RBES
SH
Steve Harrington viewed 5 orders and checked in at Starcourt Mall
KW
Karen Wheeler checked in at the Fun Fair, placed Order #1042 with the Fun Fair, bought a bag of soft pretzels at the Fun Fair and 1 more
the Ferris wheela bag of soft pretzels
JT
Jasper Tey checked in at the Fun Fair, got a red, white and blue balloon, had a pretzel at the Fun Fair and 4 more
the carousel
MB
Murray Bauman wrote Murray’s gate investigation, checked in at the Fun Fair and had a hot dog at the Fun Fair
a hot dog
A
Alexei checked in at the Fun Fair, played 3 games and won a stuffed Woody Woodpecker
JB
Joyce Byers checked in at the Fun Fair
JH
Jim Hopper checked in 2 times at the Hopper cabin and the Fun Fair
LK
Larry Kline checked in 2 times at the Fun Fair and rode the Gravitron
LS
the fireworks
MMWBJB
Max Mayfield, Will Byers, Jonathan Byers and 3 more checked in at the Hopper cabin

Yesterday

RB
Find where the elevator goes

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

THBLJB
MB
Murray Bauman let the chief in at Murray's warehouse
N
Ned served Order #1036
SH
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
JBJH
Joyce Byers and Jim Hopper checked in at the Hess farm

Tuesday

ES
Erica Sinclair saved Order #2031 2 times, placed 9 orders with Scoops Ahoy, sent a note about Order #1035 and 5 more
WBE
MM
LS
MW
DH
SH
Steve Harrington published 2 notices, put 2 items on the menu, changed the price of USS Butterscotch and 12 more
TH
Tom Holloway let 2 people go
JBJH
Joyce Byers and Jim Hopper checked in at Hawkins Town Hall

Monday

JHJB
Jim Hopper and Joyce Byers checked in at Hawkins Lab
JB
A fairground at night
A fairground at night
JT
Jasper Tey merged 2 pull requests into cerebro
ES
Erica Sinclair placed 5 orders with Scoops Ahoy
SC
Ticket #101

Every magnet on the store display fell off at once, then did it again an hour later.

MME

Sunday

SH
Steve Harrington added USS Butterscotch to the menu, changed the price of USS Butterscotch, served Order #1034 and 1 more
RB
Crack the code

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

JH
Jim Hopper checked in 2 times at Hawkins Town Hall and Enzo's and booked a table at Enzo's
MME
Max Mayfield and Eleven checked in at Starcourt Mall
DH
Dustin Henderson checked in at Scoops Ahoy and placed Order #1034 with Scoops Ahoy
JB
Jonathan Byers uploaded 4 photos to the Hawkins Post
Rolled newspapersA room lit redArcade machines in a dark room
TH
They came back every night for my fertilizer, bag after bag
Doris Driscoll
NW
They came back every night for my fertilizer, bag after bag
Doris Driscoll

Saturday

DD
Doris Driscoll phoned the Hawkins Post about the rats
DH
Dustin Henderson joined the Party, checked in at Weathertop, radioed Suzie 3 times and 2 more
KWBH
MMLSWB
Max Mayfield, Lucas Sinclair, Will Byers and 1 more checked in at Weathertop
JT
Jasper Tey starred cerebro
cerebro
About
The radio built at camp, to reach Utah from Weathertop
Visibility
Public

Friday

JB
Ticket #102

The power went out across town this evening. It came back on its own a minute later.

MMLSMW
RB
SH
Steve Harrington served 2 orders
JT
Jasper Tey merged 3 pull requests into cerebro
DH
cerebro
About
The radio built at camp, to reach Utah from Weathertop
Visibility
Public

Log ​

Log mode displays each activity in a separate row.

A controller, or wherever the feed is read
php
use Storyfeed\Facades\Storyfeed;

Storyfeed::feed()->log()->get();

Today

DH
Dustin Henderson wrote Planck’s constant
Planck’s constant is 6.62607004.
Suzie, over Cerebro
RB
Robin Buckley checked in at Starcourt Mall
SH
Steve Harrington checked in at Starcourt Mall
ES
Erica Sinclair checked in at Starcourt Mall
DH
Dustin Henderson checked in at Starcourt Mall
KW
the Ferris wheel
the Ferris wheel
MB
a hot dog
a hot dog
JB
Joyce Byers checked in at the Fun Fair
JH
Jim Hopper checked in at the Fun Fair
A
Alexei checked in at the Fun Fair
MB
Murray Bauman checked in at the Fun Fair
KW
a bag of soft pretzels
a bag of soft pretzels
JT
the carousel
the carousel
LK
KW
Order #1042 items
2 moreOrder #1042
JT
Jasper Tey had a bite of a pretzel at the Fun Fair
a pretzel
a pretzel
JT
Jasper Tey checked in at the Fun Fair
KW
Karen Wheeler checked in at the Fun Fair
LS
the fireworks
the fireworks
MM
Max Mayfield checked in at the Hopper cabin
LS
Lucas Sinclair checked in at the Hopper cabin
WB
Will Byers checked in at the Hopper cabin
JB
Jonathan Byers checked in at the Hopper cabin
NW
Nancy Wheeler checked in at the Hopper cabin
MW
Mike Wheeler checked in at the Hopper cabin
E
Eleven checked in at the Hopper cabin
JH
Jim Hopper checked in at the Hopper cabin
MB
Murray Bauman wrote Murray’s gate investigation
Murray’s gate investigation

What the machine needs

Alexei’s account: the machine is opening a gate beneath the mall.

  • Locate the control room.
  • Reach the two shutdown keys.
  • Check the safe combination before going in.

Working note: translation is evidence, not a complete floor plan.

LK
Larry Kline checked in at the Fun Fair

Yesterday

RB
Find where the elevator goes

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

MB
Murray Bauman let the chief in at Murray's warehouse
N
Ned served Order #1036
SH
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
JB
Joyce Byers checked in at the Hess farm
JH
Jim Hopper checked in at the Hess farm

Tuesday

ES
Open the loading bay door

Unlock the storeroom door from the inside so the others can get in.

ES
Get through the air ducts

Crawl through the ducts into the locked storeroom.

E
SH
Steve Harrington marked Order #2031 ready
SH
SH
SH
SH
ES
Erica Sinclair replied about Is that free for life, or only for today?
SH
SH
Steve Harrington marked Order #1035 ready
ES
SH
ES
Erica Sinclair sent a note about Order #1035
SH
SH
Steve Harrington changed the price of USS Butterscotch
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
SH
Steve Harrington added a photo of USS Butterscotch
USS Butterscotch
USS Butterscotch
TH
Tom Holloway let Jonathan Byers go from the Hawkins Post

hawkins-post-internship-agreement.pdf · 60 KB · application/pdf

TH
Tom Holloway let Nancy Wheeler go from the Hawkins Post

hawkins-post-internship-agreement.pdf · 60 KB · application/pdf

SH
Steve Harrington put USS Butterscotch on the menu
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
JB
Joyce Byers checked in at Hawkins Town Hall
JH
Jim Hopper checked in at Hawkins Town Hall
SH

Starcourt Mall visitor guide

The visitor guide includes entrances, parking and shop locations.

SH

Scoops Ahoy opening hours

The counter opens at 10 am. Orders are available until 9 pm.

Monday

JH
Jim Hopper checked in at Hawkins Lab
JB
Joyce Byers checked in at Hawkins Lab
JB
A fairground at night
A fairground at night
JT
Pull request #5
Title
Filter out the static
Branch
static-filter
Files changed
2
JT
Pull request #4
Title
Add a tape recorder input
Branch
tape-input
Files changed
4
RB
Map the code to the mall

Match each line of the message to a place in the mall.

SC
Ticket #101

Every magnet on the store display fell off at once, then did it again an hour later.

E

Sunday

SH
Match the music to the mall

Pick out the mall in the sounds behind the message on the tape.

RB
Crack the code

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

JH
Jim Hopper checked in at Enzo's
JH
Jim Hopper booked a table at Enzo's
JH
Jim Hopper checked in at Hawkins Town Hall
MM
Max Mayfield checked in at Starcourt Mall
E
Eleven checked in at Starcourt Mall
DH
Dustin Henderson checked in at Scoops Ahoy
JB
Rolled newspapers
Rolled newspapers
JB
A room lit red
A room lit red
JB
Arcade machines in a dark room
Arcade machines in a dark room
JB
A small-town street from above
A small-town street from above
TH
They came back every night for my fertilizer, bag after bag
Doris Driscoll
NW
They came back every night for my fertilizer, bag after bag
Doris Driscoll
SH
Steve Harrington changed the price of USS Butterscotch
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
SH
Steve Harrington added a menu item, USS Butterscotch
USS Butterscotch
Price
$2.95
Section
Sundaes
Available
At the counter
Orders
12
JB
Ticket #101

Every magnet on the store display fell off at once, then did it again an hour later.

JB
Ticket #101

Every magnet on the store display fell off at once, then did it again an hour later.

Saturday

DD
Doris Driscoll phoned the Hawkins Post about the rats
DH
Dustin Henderson wrote Cerebro reception log
Cerebro reception log
STATION: CEREBRO / WEATHERTOP
CALL TO UTAH .......... NO REPLY
UNEXPECTED SIGNAL .... VOICE / RUSSIAN
MESSAGE .............. REPEATING
NEXT STEP ............ KEEP THE TAPE
DH
Record the broadcast

Tape the Russian message Cerebro picked up on Weathertop.

DH
Dustin Henderson radioed Suzie
DH
Dustin Henderson radioed Suzie
DH
Dustin Henderson radioed Suzie
MM
Max Mayfield checked in at Weathertop
LS
Lucas Sinclair checked in at Weathertop
WB
Will Byers checked in at Weathertop
MW
Mike Wheeler checked in at Weathertop
DH
Dustin Henderson checked in at Weathertop
JT
Jasper Tey starred cerebro
cerebro
About
The radio built at camp, to reach Utah from Weathertop
Visibility
Public
DH
Dustin Henderson came home to the Party

Friday

JB
Ticket #102

The power went out across town this evening. It came back on its own a minute later.

MM
Day of the Dead
Director
George A. Romero
Showing
Sneak preview
LS
Day of the Dead
Director
George A. Romero
Showing
Sneak preview
MW
Day of the Dead
Director
George A. Romero
Showing
Sneak preview
WB
Day of the Dead
Director
George A. Romero
Showing
Sneak preview
RB
JT
Pull request #3
Title
Boost the range to reach Utah
Branch
utah-range
Files changed
2
JT
Pull request #2
Title
Wire up the transmitter
Branch
transmitter
Files changed
5
JT
Pull request #1
Title
Add the antenna mount
Branch
antenna-mount
Files changed
3
DH
cerebro
About
The radio built at camp, to reach Utah from Weathertop
Visibility
Public

All modes use the same payload structures.

Choosing the Summary Period ​

The summary method groups by day by default. Pass a Period to select another calendar period:

A controller, or wherever the feed is read
php
use Storyfeed\Facades\Storyfeed;
use Storyfeed\Grouping\Period;

Storyfeed::feed()->summary(Period::Week)->get();
DH
Dustin Henderson placed 2 orders with Scoops Ahoy, joined the Scoops Troop, checked in at Starcourt Mall and 1 more
RB
Robin Buckley placed Order #1104 with Scoops Ahoy, completed 2 tasks on the Scoops Troop board, joined the Scoops Troop and 1 more
SH
Steve Harrington published 2 notices, put 2 items on the menu, changed the price of USS Butterscotch and 19 more
ES
Erica Sinclair placed 15 orders with Scoops Ahoy, saved Order #2031 2 times, sent a note about Order #1035 and 6 more
KW
Karen Wheeler checked in at the Fun Fair, placed Order #1042 with the Fun Fair, bought a bag of soft pretzels at the Fun Fair and 1 more
the Ferris wheela bag of soft pretzels
JT
Jasper Tey merged 2 pull requests into cerebro, checked in at the Fun Fair, got a red, white and blue balloon and 5 more
the carousel
MB
Murray Bauman checked in 2 times at Murray's warehouse and the Fun Fair, wrote Murray’s gate investigation and had a hot dog at the Fun Fair
a hot dog
A
Alexei had a cherry Slurpee at the 7-Eleven, checked in at the Fun Fair, played 3 games and 1 more
JB
Joyce Byers checked in 4 times at Hawkins Lab, Hawkins Town Hall, the Hess farm and 1 more
JH
Jim Hopper checked in 5 times at Hawkins Lab, Hawkins Town Hall, the Hess farm and 2 more
LK
Larry Kline checked in 2 times at the Fun Fair and rode the Gravitron
LS
Lucas Sinclair placed Order #2044 with Scoops Ahoy, checked in 2 times at the Hawkins Community Pool and the Hopper cabin, had New Coke at Bradley's Big Buy and 1 more
the fireworks
MM
Max Mayfield checked in 3 times at the Hawkins Community Pool and the Hopper cabin and placed Order #2045 with Scoops Ahoy
WB
JB
A fairground at night
NW
MW
Mike Wheeler placed Order #2043 with Scoops Ahoy and checked in 2 times at the Hawkins Community Pool and the Hopper cabin
E
Eleven checked in 3 times at the Hawkins Community Pool and the Hopper cabin
TH
Tom Holloway let 2 people go and checked in at Hawkins Memorial Hospital
N
Ned served Order #1036
SC
Ticket #101

Every magnet on the store display fell off at once, then did it again an hour later.

SH
Steve Harrington served 3 orders, added USS Butterscotch to the menu, changed the price of USS Butterscotch and 1 more
RB
JH
Jim Hopper checked in 2 times at Hawkins Town Hall and Enzo's and booked a table at Enzo's
BH
Billy Hargrove checked in 2 times at the Hawkins Community Pool
MM
Max Mayfield watched Day of the Dead at Starcourt Mall and checked in 2 times at Weathertop and Starcourt Mall
E
Eleven checked in at Starcourt Mall
DH
Dustin Henderson created cerebro, joined the Party, checked in 2 times at Weathertop and Scoops Ahoy and 6 more
JB
Jonathan Byers uploaded 4 photos to the Hawkins Post
Rolled newspapersA room lit redArcade machines in a dark room
TH
They came back every night for my fertilizer, bag after bag
Doris Driscoll
NW
They came back every night for my fertilizer, bag after bag
Doris Driscoll
JB
DD
Doris Driscoll phoned the Hawkins Post about the rats
LS
Lucas Sinclair watched Day of the Dead at Starcourt Mall and checked in at Weathertop
WB
Will Byers watched Day of the Dead at Starcourt Mall and checked in at Weathertop
MW
Mike Wheeler watched Day of the Dead at Starcourt Mall and checked in at Weathertop
JT
Jasper Tey merged 3 pull requests into cerebro and starred cerebro
PeriodCalendar Period
Period::Hourhour
Period::Dayday; the default
Period::WeekISO week, starting Monday
Period::Monthmonth

You may also pass a string, such as ->summary('week'). Periods use calendar boundaries in app.timezone. To retrieve activities from the last hour, apply a constraint with the query method: ->query(fn (ActivityBuilder $query) => $query->where('published_at', '>=', now()->subHour())).

This period applies only to summary mode. Configure each verb's grouping period separately; see Grouping Periods.

Filtering Activities ​

Filtering by Entity or Role ​

Use the involving method to retrieve activities that reference an entity in any role:

A controller, or wherever the feed is read
php
use Storyfeed\Facades\Storyfeed;

Storyfeed::feed()->involving($order)->get();
$order->storyfeed()->get();   // the same read, from the model

You may also filter by a specific role:

CallReturns
->involving($model)activities where the model is actor, object, target, context, origin, result, or instrument
->context($shop)activities with the shop in the context role
->actor($customer)activities performed by the customer
->object($order) / ->target($shop)activities matching the specified role

Constraints on different roles combine, and group counts include only matching activities. Calling the same role setter again replaces its previous value on a plain builder. A role locked by a feed class cannot be rebound; additional filters preserve that outer scope.

NOTE

The difference between involving and context

The context method matches only the context role. An activity that adds a product to a menu assigns the product to the object role, so use involving to include it in the product's feed. See Containers & Context.

Filtering by Verb ​

Use the verb method to filter by one verb. The only and except methods accept lists:

A controller, or wherever the feed is read
php
use App\Enums\OrderActivity;
use Storyfeed\Facades\Storyfeed;

Storyfeed::feed()->verb('place')->get();
Storyfeed::feed()->only(['place', 'ready'])->get();
Storyfeed::feed()->only(['re*', OrderActivity::Confirmed])->get(); // matches ready, reprice and confirm
Storyfeed::feed()->except(['note'])->get();
InputBehaviour
a listaccepts verb strings and enum cases together
re*matches verbs starting with re
an unrecognised verbmatches no activities unless that verb has been recorded; does not throw
only([]) or except([])throws an exception
repeated only() / except() callsactivities must match every accumulated filter
repeated verb() callsthe last value replaces the previous verb

Groups include only activities whose verbs match the filter.

Custom Query Constraints ​

Use the query method to apply custom constraints to the activity query:

A controller, or wherever the feed is read
php
use Storyfeed\Models\Builders\ActivityBuilder;

// everything except notes
$shop->storyfeed()
    ->query(fn (ActivityBuilder $q) => $q->whereNot('verb', 'note'))
    ->get();

// tonight's service
$shop->storyfeed()
    ->query(
        fn (ActivityBuilder $query) => $query
            ->where('published_at', '>=', today()->setHour(17)),
    )
    ->get();

Constraints apply to activities and groups. The callback can only narrow the results: orWhere cannot bypass existing filters, ordering is ignored, and limit() or offset() throws an exception. Set the page size with the feed builder's limit method.

Conditional Constraints ​

Use the when method to apply a filter only when a value is present:

A controller, or wherever the feed is read
php
use App\Models\Shop;
use Storyfeed\Facades\Storyfeed;
use Storyfeed\FeedBuilder;

Storyfeed::feed()
    ->when($request->shop, fn (FeedBuilder $feed, Shop $shop) => $feed->involving($shop))
    ->get();

Paginating Results ​

To paginate a feed, call the cursorPaginate method. It returns a Storyfeed\FeedPaginator and retrieves the cursor from the current request:

routes/web.php
php
use Illuminate\Support\Facades\Route;
use Storyfeed\Facades\Storyfeed;

Route::get('/', function () {
    return view('feed', [
        'page' => Storyfeed::feed()->cursorPaginate(15),
    ]);
});

The argument specifies the number of items per page. If you omit it, the paginator uses the builder's limit, which defaults to 30. Iterating over the paginator returns Storyfeed\Support\FeedItem instances.

To display pagination links in Blade, call the links method:

resources/views/feed.blade.php
blade
@foreach ($page as $item)
    {{ $item->headline() }}
@endforeach

{{ $page->links() }}

The paginator uses Laravel's simple pagination views, including any views you have customized in your application. Feeds paginate forward only, so the previous-page link is disabled. The nextPageUrl method returns the next page's URL, or null on the last page. The previousPageUrl method returns null. See Storage Architecture for what a cursor holds.

Customizing Pagination URLs ​

To use a different query string parameter, pass its name as the second argument:

php
$page = Storyfeed::feed()->cursorPaginate(15, 'feed_cursor');

Use the withQueryString method to include the current request's query string in pagination links. You may also append specific values or a URL fragment:

php
$page = Storyfeed::feed()->cursorPaginate(15)->withQueryString();

$page->appends(['filter' => 'mine'])->fragment('activity');

Returning JSON ​

Returning the paginator from a route produces JSON with Laravel's data, path, per_page, next_cursor, next_page_url, prev_cursor, and prev_page_url keys. It also includes the feed's payload_version, items, and sync_token keys. The data and items arrays contain the same items; prev_cursor and prev_page_url are null.

Cursor strings are opaque. Pass them back unchanged without decoding or constructing them. In PHP, the paginator's nextCursor method returns a Laravel cursor object; its encode method returns the opaque string.

Paginating Without a Request ​

For jobs and commands, use the get method. It returns a FeedPage, whose nextCursor method returns the opaque string for the next page:

php
$page = Storyfeed::feed()->limit(15)->get();

if ($cursor = $page->nextCursor()) {
    $nextPage = Storyfeed::feed()->limit(15)->cursor($cursor)->get();
}

Handling a Changed Feed ​

Use these response fields for subsequent requests:

KeyUsage
next_cursorpass as ?cursor= to retrieve the next page; null on the last page
sync_tokenif it changes, discard previously loaded items and request the first page again

Use a cursor with the same feed constraints, filters, mode, and query callbacks that produced it.

Released under the MIT License.