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 loading

After editing cached definitions, run storyfeed:cache again.

Tables and Models ​

KeyDefaultDescription
tables.activities'feed_activities'the activities
tables.snapshots'feed_snapshots'entity snapshots
tables.groupings'feed_groupings'each activity's groupings
tables.participants'feed_participants'index queried by involving()
tables.parties'feed_parties'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::class
models.snapshotSnapshot::class
models.groupingGrouping::class
models.partyParty::class
models.batchBatch::class
models.metaMeta::class
models.tombstoneFeedTombstone::class

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.party'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

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 until storyfeed:prune removes them; '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.

Grouping ​

KeyDefaultDescription
grouping.strategyMultiAxisStrategy::classgrouping strategy; use NullStrategy to disable grouping
grouping.default'live'default read mode: 'log' for individual activities, 'live' for selected groups, 'summary' for per-actor summaries
grouping.curatetruechoose which group shows each activity at publication; false limits live() to repeats
grouping.summary.phrases3maximum phrases per summary row; phrases_truncated reports omitted phrases
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 axis
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, and instrument. 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.

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

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.scheduletruerun storyfeed:curate hourly to choose groups for recent activities; requires Laravel's scheduler
curate.window2days included in scheduled grouping; weekly and monthly declarations extend this 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.prunefalsedelete 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
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
demo.enabledfalseregister the vocabulary used by storyfeed:demo so seeded activities render; enable only in the demo environment

Released under the MIT License.