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

Commands ​

Introduction ​

Artisan commands install, inspect and maintain the feed.

Installing Storyfeed ​

CommandDescription
storyfeed:installpublishes config/storyfeed.php and the migrations, creates routes/feed.php from a stub, adds STORYFEED_SNAPSHOTS=sync to .env (commented out in .env.example; see Snapshots), and offers to run the migrations. --without-migrations publishes none. --without-storage publishes the configuration and creates routes/feed.php only, for an app running without tables
bash
# never overwrites an existing routes/feed.php
php artisan storyfeed:install
# the routes/feed.php stub alone
php artisan vendor:publish --tag=storyfeed-definitions

The installer preserves an existing routes/feed.php that is not a Storyfeed file and explains how to set another definitions path. Setting definitions to false disables file creation.

Installing UI Components ​

CommandDescription
storyfeed:ui vue or storyfeed:ui reactcopies the chosen kit after installing storyfeed/ui; see Installing the Kits for --path, --diff, --force and file preservation

Generating Classes ​

Stories ​

make:story creates a Story class. Without arguments, it prompts for the name and class structure. Passing only a name creates a class for one activity, constructed with its data and then published. The command prints the routes/feed.php binding for you to add. A generated resource class can also be bound one method at a time.

OptionEffect
--model=Ordera resource class for that model. Takes precedence over --invokable
--resourcea resource class: one method per verb
--invokablea single verb's __invoke() declaration
--verb=the stored verb
--object=the object model or morph alias, or * for none
--axes=comma-separated grouping axes to pre-fill; default, every axis that applies
--from-doctorone class per recorded type and verb without a headline; see Generating From Doctor Findings
--forceoverwrites an existing story

Feeds ​

CommandDescription
make:feedcreates a feed class. --force overwrites an existing feed. --subject= writes the typed constructor, --role= the bound role (default context), --only= and --mode= fill define(). --from-doctor writes one class with unclassified verbs commented out; its only([]) throws until you classify each verb with only() or except()

Listing Definitions ​

CommandDescription
storyfeed:listlists authored definitions, including provider declarations: type, verb, name, action, headlines, icon, intent, group headlines, calendar period for custom axes, keep-latest policy, override status and source location
storyfeed:verbslists every verb, the shipped defaults included, in the columns Verb, AS2.0 type, Headline, Icon and Source. Headline and Icon name the registered keys that cover the verb, such as order.place, *.place, or —. Source is registered for a verb declared with Storyfeed::verbs() or by a story class, and default for a shipped one; see Verbs. --used compares against recorded verbs
storyfeed:storieslists everything that publishes to the feed, and the models that could but don't, with each row's headline and icon coverage, group headlines, last recorded time and status (ok, gap, dead, unauthored or unwired). --gaps shows only rows that are not ok, --json, --since= sets the days after which a Story is considered inactive (default 30)

Listing Options ​

OptionEffect
--type=filters by morph alias or model class
--verb=filters by verb
--name=filters names containing this value
--jsonreturns JSON, including override, middleware and where
-vadds resolved middleware and role constraints to the table

The Action column names the declaring method, such as App\Stories\OrderStory@place, or a single-verb class. Source identifies its file and line or action. Override is yes for an explicit override. The Period column describes custom calendar axes; it does not list burst windows.

Caching Definitions ​

CommandDescription
storyfeed:cachecompiles stories registered by service providers and the feed file into a cached manifest; also runs on php artisan optimize. Run it again after adding a method to a Story class
storyfeed:clearremoves the cached manifest

Like route:cache, storyfeed:cache prevents the definitions file from loading at boot. It serialises closure headlines and fails with a file:line reference if a closure cannot be serialised. Keep only Story definitions in the feed file; register verb vocabulary in a service provider.

Providers still boot when definitions are cached. Feeds use the compiled manifest, while storyfeed:list shows authored declarations rather than the merged definitions used by a cached feed.

Running Diagnostics ​

CommandDescription
storyfeed:doctoraudits headline, icon and AS2 type coverage, and feed health. See Command Options for its flags

See Diagnosing Your Feed for usage and Doctor Checks for the checks, link sampling and acknowledgments.

Inspecting Storyfeed With About ​

Laravel's about command has a Storyfeed section:

bash
php artisan about --only=storyfeed
LineReports
Definitionswhether routes/feed.php is loaded, or cached and skipped at boot
Cachewhether storyfeed:cache has run, and when
Verbshow many are declared, and how many ship as defaults
Object types, Stories, Feedshow many are registered
Recordingwhether recording is on
Snapshotsthe snapshot compile mode, cached or sync
Curate, Trickle and Close-batches scheduleswhether storyfeed:curate, storyfeed:trickle and storyfeed:close-batches are scheduled
Doctorwhat the tables, recording and manifest checks report; storyfeed:doctor runs them all

The section works without a database and supports --json.

Scheduling Maintenance ​

The feed works without a scheduler. When Laravel's scheduler runs, Storyfeed schedules storyfeed:curate hourly unless curate.schedule is false, and storyfeed:prune --bursts daily unless grouping.burst_retention_days is null. Schedule other maintenance commands in your application:

CommandDescriptionSuggested
storyfeed:tricklekeeps entity snapshots and deletions up to date, including models deleted without a model event, such as by a query builder delete. --limit=; --prune soft-deletes activities with an uncached role that cannot resolveevery minute
storyfeed:close-batchescloses batches whose window has elapsed, dispatches BatchClosed, creates composites. --quiet-minutes=every 5 minutes
storyfeed:prunepermanently deletes activities past their verb's retention window. --days= overrides prune.after_days (per-verb retention takes precedence); --pretend reports what a run would delete, per verb, and deletes nothing. --bursts only removes closed burst windows older than grouping.burst_retention_days, and deletes no activitiesdaily, if a verb declares a window or prune.after_days is set
routes/console.php
php
use Illuminate\Support\Facades\Schedule;

Schedule::command('storyfeed:trickle')->everyMinute();
Schedule::command('storyfeed:close-batches')->everyFiveMinutes();
Schedule::command('storyfeed:prune')->daily();

Maintaining Stored Activities ​

See Choosing a Maintenance Operation for healing, unresolved-role pruning, retention, and tombstones. To correct how historical activities appear, see Correcting Historical Presentation.

Rebuilding Snapshots ​

CommandDescription
storyfeed:rebuildrebuilds every entity snapshot and link from toFeed(); --recent=N limits the pass to entities named by the newest N activities
storyfeed:cache-snapshotsbounded snapshot refresh run after every php artisan migrate, even with nothing to migrate; warns and skips when it can't run

storyfeed:rebuild does not change the recorded verb, roles, or activity data.

Rehashing Groups ​

Storyfeed stores group memberships at publication. To apply a new axis or a changed grouping key to existing activities, run:

bash
php artisan storyfeed:curate --rehash   # --window= bounds it by published_at

--rehash reruns the grouping strategy and re-evaluates which group shows each activity. It preserves existing burst boundaries; changed burst windows need --rebuild-bursts. Neither option rewrites an activity's verb, roles, or data.

Changes to grouping.policy thresholds only affect eligibility. Plain php artisan storyfeed:curate re-evaluates existing candidate hashes against those thresholds; it does not need --rehash.

Scheduled curate runs never rehash; run --rehash explicitly.

To rebuild Live bursts for all stored history, pause readers, every publisher, queue worker, and publishing schedule for the full rebuild. Maintenance mode alone does not stop queue workers. Then confirm that writers are paused:

bash
php artisan storyfeed:curate --rebuild-bursts --writers-paused

The rebuild commits progress in chunks. After an interruption, add --resume to continue from the committed cursor; add --restart to discard progress and replay all history. Keep readers and writers paused until completion.

Rehashing can move groups past an active cursor, leaving the next page empty. It changes sync_token, so clients must discard accumulated nodes and fetch from the start, even after an empty response. See the Sync token rule.

Releasing Orphaned Composites ​

If a composite parent is force-deleted while its members still appear in the composite, the doctor reports claims.parent_gone. Use --release to return them to ordinary grouping:

bash
php artisan storyfeed:curate --release   # a second run changes nothing

Releasing members changes sync_token. Soft-deleted parents keep their members.

Other Maintenance Commands ​

CommandDescription
storyfeed:curatechooses which group shows each activity with live() (backfill/repair); scheduled hourly by the package unless curate.schedule is false. --rehash, --window=, --release; --rebuild-bursts --writers-paused rebuilds all history, with --resume after interruption or --restart to replay it. When grouping.curate is false it does nothing and says so; --release still releases orphaned composites
storyfeed:healsoft-deletes activities whose source is permanently absent. --pretend previews; repeat --only= to select healers
storyfeed:bundlecombines Bundleable activities in closed batches into composites. --window=
storyfeed:participantsrebuilds the index queried by involving(). --missing, --chunk=. --ancestors --writers-paused rebuilds history from current parents; adding --missing fills only never-recorded paths. --resume and --restart handle interrupted runs. See Distant Relations

bundle and curate can change existing groups and their sync_token. Clients that accumulate nodes must then fetch the feed again.

Released under the MIT License.