← Previous · Back to README · Next →
Events
Feeds dispatch two events when running the command:
DragonCode\LaravelFeed\Events\FeedStartingEvent— TheFeedStartingEventis dispatched after storage and path preflight, before converter resolution and staging. It does not mean that a draft file exists.DragonCode\LaravelFeed\Events\FeedFinishedEvent— TheFeedFinishedEventis dispatched after every generated file has been published successfully. A failed generation does not dispatch this event.
Both events expose $feed with the generated feed class and nullable $target with the target key. $target is null for an ordinary feed.
Finished event contract
The finished event exposes these public properties:
$pathscontains every published file path in output order.$pathremains available for backward compatibility and contains the first published path. Use$pathswhen a feed can be split across files.
GeneratorService::feed() returns a GenerationResultData object. Its $paths property contains the same ordered paths, and its $records property maps each path to the number of records written to that file.