Frequently asked questions
Short answers to common setup, generation, storage, format, and memory questions.
Can Laravel Feeds export millions of records?
Yes. The package reads Eloquent results in chunks and writes output incrementally. Keep builder() lazy, avoid calling get() or toArray() on the full result, and tune chunkSize() after measuring memory and database load.
Which format should I use?
Use the consumer's required contract. XML and RSS support hierarchical directives, JSON preserves nested data, JSON Lines is suited to line-oriented processing, and CSV requires a stable column schema.
See supported formats.
Can one feed create multiple files?
Yes, but choose the mechanism based on why the files differ:
- Use
perFile()and optionallymaxFiles()to split one dataset into sequential parts with a fixed number of records. - Use feed targets to create a separate filtered output for each partner, store, locale, or other business key.
- Combine both mechanisms when each partner output may also need several record-count parts.
See the multiple targeted feed files recipe for a complete example.
Can I store feeds on S3 or another remote disk?
Yes, when the configured Laravel disk resolves to a writable FilesystemAdapter. Remote moves may be implemented as copy and delete, so atomic replacement is not guaranteed.
See supported disks.
Why did a disabled feed run?
Passing a feed ID to feed:generate executes that feed even when its registration is inactive. Running the command without an ID skips inactive registrations.
How do I omit an optional field?
Return DragonCode\LaravelFeed\Data\OptionalData or Spatie\LaravelData\Optional as the field value. CSV keeps the column and writes an empty value; object and XML formats omit the field.
See optional values.