PHPackages                             piyook/csvseeder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. piyook/csvseeder

ActiveLibrary[Database &amp; ORM](/categories/database)

piyook/csvseeder
================

Seed data into Laravel DB tables from .csv files

v1.0.1(4y ago)07MITPHPPHP &gt;=8.0

Since May 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/piyook/csvseeder)[ Packagist](https://packagist.org/packages/piyook/csvseeder)[ Docs](https://piyook.com)[ RSS](/packages/piyook-csvseeder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

### CSV Database Seeder Utility Service

[](#csv-database-seeder-utility-service)

 A simple Laravel utility package to seed database tables with CSV data.
 [**Explore the docs »**](https://github.com/piyook/laravelcsvseed)

 Table of Contents
-----------------

[](#table-of-contents)

1. [About The Project](#about-the-project)
    - [Built With](#built-with)
2. [Getting Started](#getting-started)
    - [Prerequisites](#prerequisites)
    - [Installation](#installation)
3. [Usage](#usage)
4. [Contact](#contact)

About The Project
-----------------

[](#about-the-project)

A simple utility for Laravel that allows a database to be quickly populated using data from a file in CSV format.

A custom Artisan make: command builds the CSV seeder class which then imports data from a CSV file stored in database/data folder.

### Built With

[](#built-with)

- Laravel 9

Getting Started
---------------

[](#getting-started)

The code can be added to a fresh Laravel install or an existing project.

### Prerequisites

[](#prerequisites)

Laravel 8+

### Installation

[](#installation)

Install the package using composer

```
    composer require --dev piyook/csvseeder
```

Usage
-----

[](#usage)

A custom Artisan make command was developed to make scaffolding a Seeder Class to import CSV files easier.

The CSV data file **must share the same name as the table and be stored in a database/data folder.**

To use the Artisan command simply type :

```
 php artisan make:csvseeder    (optional)
```

Where the table name to be seeded is passed to the make command along with an ARRAY of column names \[\].
Note that if the table name is plural then the singular form will be used for the class name

If the seeder class is to be stored in a location OTHER than database/seeders then you can specify this new path as the final option.

**E.g A new Seeder Class for a table called "examples" which will import from the "examples.csv" file held in database/data, will be saved to the database/seeders directory with the filename "ExampleCSV.php".**

```
  php artisan make:csvseeder examples [col1,col2,col3,col4]
```

then

```
php artisan migrate:fresh

php artisan db:seed --class=ExampleCSV
```

**DONT FORGET TO REGISTER THE NEW CSV SEEDER IN THE DatabaseSeeder CLASS IN THE SEEDERS FOLDER BEFORE RUNNING A GENERAL DB SEED AS PART OF A MIGRATION WITH THE --SEED OPTION**

Testing
-------

[](#testing)

Orchestra Testbench would normally be used to run unit and feature tests in the package but the seeder function would not work (the seeder class was not found).

A full seperate Laravel test project was set-up and the tests, phpunit.xml and the database/data, database/migration folders and files in the package test folder copied into the relevant places in the project to set up the test environment.

All Feature tests work running with Artisan test command.

Contact
-------

[](#contact)

Email: piyook@piyook.com

Project Link: \[laravelcsvseed\]

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

1465d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64b050e6de9d3412bf143a6e3a6753ed75367dfe3f8ed09f872afbe663044bfc?d=identicon)[piyook](/maintainers/piyook)

---

Top Contributors

[![piyook](https://avatars.githubusercontent.com/u/51154763?v=4)](https://github.com/piyook "piyook (3 commits)")

---

Tags

artisan-commandcsvdatabaselaravelseederlaravelDevtoolscsvseedermigration-tool

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/piyook-csvseeder/health.svg)

```
[![Health](https://phpackages.com/badges/piyook-csvseeder/health.svg)](https://phpackages.com/packages/piyook-csvseeder)
```

###  Alternatives

[woenel/prpcmblmts

Philippines region, province, cities/municipalities and barangays Laravel migration and table seeder.

2818.3k](/packages/woenel-prpcmblmts)[matriphe/laraciproid

Indonesia city and province data migration and seeder for Laravel.

232.5k](/packages/matriphe-laraciproid)[pmatseykanets/artisan-io

Artisan data import command for Laravel

172.0k](/packages/pmatseykanets-artisan-io)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
