Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Csv Seeder Laravel Package

flynsarmy/csv-seeder

Seed your Laravel database directly from CSV files with this extension to the built-in seeder. Map columns to table fields, handle large files, and skip writing PHP seed classes by hand—ideal for importing existing data quickly and repeatably.

View on GitHub
Deep Wiki
Context7

flynsarmy/csv-seeder is a Laravel package that lets you seed database tables directly from CSV files instead of writing large PHP seed arrays. Configure the CSV path, target table, delimiter, and header handling, then run it through Laravel’s seeder workflow for fast, repeatable imports.

  • Seed any table from a CSV source
  • Customize delimiters, enclosures, escape characters, and line endings
  • Skip header rows and map CSV columns to table fields
  • Truncate existing data before seeding
  • Supports chunked inserts for large files
Frequently asked questions about Csv Seeder
How do I install and use flynsarmy/csv-seeder in a Laravel application?
Add the package with Composer, create a seeder class that extends the package's CSV seeder, point it at a CSV file, and define your column mapping. Then run it through the normal Laravel seeding pipeline, such as php artisan db:seed. No service provider, queue, or external infrastructure is required, so integration effort is low for compatible Laravel and PHP versions.
Which Laravel and PHP versions does flynsarmy/csv-seeder support?
The package's last release was April 2021, so its Composer constraints predate recent Laravel major versions and newer PHP 8.x releases. Validate the package against your exact Laravel and PHP matrix before committing, and pin the version you test. Expect possible framework API friction and plan for a fork or internal replacement if compatibility breaks.
How do I map CSV columns to database table columns?
The seeder class supports configurable headers and row mapping, so you define which CSV column feeds which database column. This keeps bulk imports readable instead of writing individual insert statements. Test the mapping against representative files, especially when headers vary or columns are reordered.
Can flynsarmy/csv-seeder handle large CSV files without memory problems?
It is adequate for small-to-medium fixture and reference datasets. Large CSVs can create memory pressure and long-running seeders depending on chunking and insert strategy, so measure memory and runtime against representative file sizes. For high-volume ingestion, consider a maintained CSV library or a custom chunked seeder instead.
Are CSV inserts transactional or idempotent with this package?
The package does not document explicit transaction handling, so partial inserts are a secondary risk on failure. Wrap seeding in a database transaction and decide how duplicates or existing rows should be handled, such as truncation or upserts. Test rollback behavior before using it for anything beyond disposable development fixtures.
Is flynsarmy/csv-seeder safe to use for production reference data?
It fits Laravel's native seeding lifecycle, but it is not a general-purpose ingestion or ETL framework. The main concern is lifecycle risk: the last release was in 2021, stars are modest, and ecosystem validation is limited. Treat production use as a contained, reversible experiment and confirm requirements around truncation, duplicate handling, auditability, and transactions first.
What are good alternatives to flynsarmy/csv-seeder for Laravel CSV imports?
Common alternatives are a native Laravel Seeder using fgetcsv(), a maintained CSV library such as league/csv, or a small internal seeder base class. These options give you more control over streaming, transactions, encoding, and duplicate handling. Compare behavior on an ephemeral database before choosing a long-term dependency.
How do I configure delimiters, headers, and encoding for CSV seeding?
The package provides configurable delimiters and headers, but encoding and delimiter edge cases remain a secondary risk. Standardize on conventions such as UTF-8 and a consistent delimiter before broader rollout. Test header mapping, type coercion, and encoding against real files rather than only simple examples.
Is flynsarmy/csv-seeder actively maintained?
The last release was April 2021, with 256 stars and reported dependents of zero, which signals limited recent activity and ecosystem validation. The MIT license makes forking legally straightforward, but it does not reduce the operational ownership cost. Assume de facto maintenance responsibility for compatibility fixes, security review, and PHP or Laravel upgrades.
How should I test a CSV seeder before rolling it out?
Add the package on a branch, convert one low-risk seeder, and run it against an ephemeral database. Compare its behavior with a native Seeder plus fgetcsv() or a maintained CSV library. Check header mapping, type coercion, duplicate handling, encoding, rollback behavior, and memory use against representative file sizes before deciding to adopt, wrap, or replace it.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console