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

Configuration ​

Introduction ​

All keys in config/storyfeed.php have defaults.

Publishing Configuration ​

Publish the configuration file when you need to change the defaults:

bash
php artisan vendor:publish --tag="storyfeed-config"

Definitions ​

KeyDefaultDescription
definitionsbase_path('routes/feed.php')path to the feed file; set false to disable file loading. Provider registrations remain available

After editing cached definitions, run storyfeed:cache again.

Sources ​

KeyDefaultDescription
sources.<name>['database' => ['driver' => 'database']]named feed sources, each with a driver: database, array (reading its items, newest first unless in_order is true), or one registered with Storyfeed::extend(). A feed reads the database unless it calls source()

Tables and Models ​

KeyDefaultDescription
tables.activities'feed_activities'the activities
tables.snapshots'feed_snapshots'entity snapshots
tables.grouping_bursts'feed_grouping_bursts'latest Live burst window and lock per logical axis key
tables.groupings'feed_groupings'each activity's groupings
tables.participants'feed_participants'index queried by involving()
tables.entities'feed_entities'named participants
tables.batches'feed_batches'an actor's collected activities
tables.meta'feed_meta'sync tokens and maintenance metadata
tables.tombstones'feed_tombstones'deleted models
tables.batch_locks'feed_batch_locks'one lock per batched actor
models.activityActivity::classthe Eloquent model for activities
models.snapshotSnapshot::classthe Eloquent model for entity snapshots
models.groupingGrouping::classthe Eloquent model for activity groupings
models.partyParty::classthe Eloquent model for named parties
models.batchBatch::classthe Eloquent model for actor batches
models.metaMeta::classthe Eloquent model for feed metadata
models.tombstoneFeedTombstone::classthe Eloquent model for deleted entities

Change table names to avoid collisions or use existing feed tables. Replacement models must extend the defaults in Storyfeed\Models. See Schema for each table.

Identity ​

KeyDefaultDescription
morph_alias'storyfeed.entity'the morph alias for parties
morph_map[]merged into the app's morph map at boot
actor_resolvernullinvokable class resolving the default actor; null = authenticated user
parties.fallbacknullfallback party when no actor is resolved, such as in jobs or commands
parties.strictnullreject undeclared party names after registering a list with Storyfeed::parties(); ignored without a list. null enables this only in local/testing

Pre-0.23 published configurations can keep tables.parties (feed_parties) and morph_alias (storyfeed.party); those pins preserve existing rows.

See Parties & Anonymous Actors for named system actors and activities without a recorded actor.

Recording ​

KeyDefaultDescription
recording.enabledenv('STORYFEED_RECORDING_ENABLED', true)when disabled, every publish() returns an unsaved activity and no event is dispatched. Set it in phpunit.xml, and opt tests back in with Storyfeed\Testing\RecordsStories
keep_latest.delete'soft'how keepLatest() deletes superseded activities. 'soft' soft-deletes them, and storyfeed:prune removes them once they pass their retention window; 'force' deletes them immediately. Any other value throws when publishing

Verbs ​

KeyDefaultDescription
verbs.strictnullthrow on a verb with no registry entry. null = strict in local/testing only

Register verbs with Storyfeed::verbs() or a Story class. See Verb Vocabulary.

Distant Relations ​

KeyDefaultPurpose
ancestors.max_depth10maximum parent links followed from each object, target or context (0–255); see Distant Relations

Grouping ​

KeyDefaultDescription
grouping.strategyMultiAxisStrategy::classgrouping strategy; use NullStrategy to disable grouping
grouping.default'live'default read mode: 'log' for individual activities, 'live' for one-action bursts
grouping.bursts.within'15 minutes'quiet gap that closes a Live burst
grouping.bursts.ceiling'4 hours'maximum duration from the burst's start
grouping.burst_retention_days7days a closed burst window stays open to late arrivals, such as imports; older windows are swept by the scheduled storyfeed:prune --bursts. null keeps every window
grouping.curatetruechoose which group shows each activity at publication; false limits live() to repeats and composites, and makes storyfeed:curate a no-op apart from --release
grouping.children_limit25maximum member nodes nested in each group; count remains the full total
grouping.sample_limits.<role>3distinct entities sampled per singular role on a group node; resolved whenever a page is retrieved. Invalid or missing limits use 3
grouping.policy.min_actors3distinct actors required for the actors and actors_target axes
grouping.policy.min_targets2distinct targets required for targets
grouping.policy.min_target_members3activities required for targets
grouping.policy.min_object_members2activities required for object

sample_limits uses singular role names: actor, object, target, context, origin, result, instrument, location, and generator. featured caps the strip of members' featured entities, sample.featured. Each defaults to 3. Increase a limit when your frontend displays more names:

config/storyfeed.php
php
'grouping' => [
    // Keep the other grouping settings here.
    'sample_limits' => [
        'object' => 6,  // this feed shows the objects' pictures
        // everything else stays at 3
    ],
],

children_limit still caps the sample.

Default Grouping Keys ​

The built-in axes use these default keys:

AxisDefault Grouping Key
repeataa:aid:v:oa:ta:tid:ca:cid
actorsv:oa!:oid!:ta:tid:ca:cid
actors_targetv:ta!:tid!:ca:cid
targetsaa!:aid:v:ca:cid
objectaa:aid:v:oa!:oid!:ta:tid:ca:cid

These keys identify shared roles within built-in Live bursts. See Custom Axes for field syntax and calendar keys.

Batches and Composites ​

KeyDefaultDescription
grouping.batch.enabledtruecollect an actor's activities into batches
grouping.batch.quiet_minutes10minutes to wait for more activities before closing a batch
grouping.composite.autotruecombine Bundleable activities into composites when a batch closes
grouping.composite.min_objects2minimum distinct objects per composite

Hydration ​

KeyDefaultDescription
hydration.enabledtruewhether $context->model() loads the current model, with one query per class per page. When disabled, it returns null for your resolver to handle

Snapshots ​

KeyDefaultDescription
snapshots.compileenv('STORYFEED_SNAPSHOTS', 'cached')when toFeed() output is recompiled. 'cached': every php artisan migrate recompiles the snapshots of the newest 1,000 activities (storyfeed:cache-snapshots) and storyfeed:trickle catches up the rest. 'sync': when a feedable model or Story class file changes, the next feed read runs that same pass once. Any other value throws

storyfeed:install writes STORYFEED_SNAPSHOTS=sync to .env. The doctor warns when sync is set outside local and testing; see Available Checks.

Activity Streams Routes ​

KeyDefaultDescription
routes.enabledfalseenable the read-only single-activity endpoint
routes.prefix'storyfeed'route prefix used in activity IRIs; changing it changes document IDs
routes.middleware[]authentication or throttling middleware

Maintenance ​

KeyDefaultDescription
curate.scheduletrueschedule storyfeed:curate to choose groups for recent activities
curate.window2days included in scheduled grouping; raise this to cover any longer burst ceiling. Custom calendar axes widen it for their verbs. null or 0 includes all activities
prune.after_daysnulldefault retention period; null keeps activities. Per-verb keepFor() or keepForever() takes precedence
trickle.limit200activities processed per storyfeed:trickle run
trickle.prunefalsesoft-delete activities with an unresolvable role; otherwise count them

Diagnostics ​

KeyDefaultDescription
doctor.stale_after30days without new activity before the doctor reports a stale feed; null disables
doctor.acknowledgments[]list of exact code, complete typed subject, and nonempty reason entries accepting deliberate grammar gaps. Findings stay visible with reasons but leave active counts, CI failures, and stubs; see Acknowledgment Policy
grammar.strictnullthrow when publishing a pair with no headline. null = local/testing only
discovery.pathsnullwhere storyfeed:stories and doctor look for feedable models, stories and PublishesToFeed classes; null = app_path(). Not used at runtime

Released under the MIT License.