PHPackages                             devlabor/laravel-csv-seeder - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. devlabor/laravel-csv-seeder

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

devlabor/laravel-csv-seeder
===========================

1.0.0(6y ago)12.6k1MITPHP

Since Sep 29Pushed 6y ago2 watchersCompare

[ Source](https://github.com/DevLabor/laravel-csv-seeder)[ Packagist](https://packagist.org/packages/devlabor/laravel-csv-seeder)[ Docs](https://github.com/devlabor/laravel-csv-seeder)[ RSS](/packages/devlabor-laravel-csv-seeder/feed)WikiDiscussions master Synced 2mo ago

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

This package is based on "spatie/laravel-query-builder" allows you to rapidly creating API controllers for your Laravel application. This package also works with authorization policies.

Basic Usage
-----------

[](#basic-usage)

Create a new table seeder class: `php artisan make:seeder ProductsTableSeeder` and change the content to following code. The csv file must located in `/database/seeds/csvs/products.csv`

```
use \DevLabor\CsvSeeder\Database\Seeder\CsvSeeder

// ...

class ProductsTableSeeder extends CsvSeeder {
	/**
	 * UsersTableSeeder constructor.
	 */
	public function __construct()
	{
		$this->columnMapping = [
			0 => 'article_no',
			1 => 'name',
			2 => 'text',
			3 => 'price'
		];
	}

	/**
	 * Run the database seeds.
	 *
	 * @return void
	 */
	public function run()
	{
		// Recommended when importing larger CSVs
		\Illuminate\Support\Facades\DB::disableQueryLog();

		// Uncomment the below to wipe the table clean before populating
		\Illuminate\Support\Facades\DB::table($this->guessTableName())->truncate();

		parent::run();
	}
}
```

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require devlabor/laravel-csv-seeder
```

Usage
-----

[](#usage)

This CsvSeeder class is easy to use and usually works independently. Sometimes you need or want to customize the csv import file parameters.

### Parameters

[](#parameters)

```
// Database table name for seeding. Default guessed by class name.
public $table = '';
```

```
// CSV file name for seeding. Default guessed by class name.
public $filename = '';
```

```
// Table field that to be hashed, most likely a password field. If your password has a different name, please overload this variable from our seeder class.
public $hashable = 'password';
```

```
// An SQL INSERT query will execute every time this number of rows are read from the CSV. Without this, large INSERTS will silently fail.
public $insertChunkSize = 50;
```

```
// CSV delimiter
public $csvDelimiter = ';';
```

```
// Number of rows to skip at the start of the CSV
public $offsetRows = 0;
```

```
// Can be used to tell the import to trim any leading or trailing white space from the column;
public $trimWhitespace = true;
```

```
/**
 * The mapping of CSV to table column. If not specified manually, the first row (after $offsetRows) of your CSV will be read as your table columns.
 *
 * In order to read the first, third and fourth columns of your CSV only, use:
 * array(
 *   0 => id,
 *   2 => name,
 *   3 => description,
 * )
 */
public $columnMapping = [];
```

### Testing

[](#testing)

```
composer test
```

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

Unknown

Total

1

Last Release

2416d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4ac49f4d8027a3933d11793db700eeef391cfbded9a6ed612778c6fe39fd0ae2?d=identicon)[Kiv4h](/maintainers/Kiv4h)

---

Top Contributors

[![Kiv4h](https://avatars.githubusercontent.com/u/1305053?v=4)](https://github.com/Kiv4h "Kiv4h (11 commits)")

---

Tags

laravelcsvseederdevlabor

### Embed Badge

![Health badge](/badges/devlabor-laravel-csv-seeder/health.svg)

```
[![Health](https://phpackages.com/badges/devlabor-laravel-csv-seeder/health.svg)](https://phpackages.com/packages/devlabor-laravel-csv-seeder)
```

###  Alternatives

[bfinlay/laravel-excel-seeder

Seed the database with Laravel using Excel, XLSX, XLS, CSV, ODS, Gnumeric, XML, HTML, SLK files

3944.4k](/packages/bfinlay-laravel-excel-seeder)[jeroenzwart/laravel-csv-seeder

Seed the database with Laravel using CSV files

97395.6k2](/packages/jeroenzwart-laravel-csv-seeder)[crockett/csv-seeder

Database seeding using CSV files

23173.5k](/packages/crockett-csv-seeder)[initred/laravel-tabula

laravel-tabula is a tool for liberating data tables trapped inside PDF files for the Laravel framework.

1418.6k](/packages/initred-laravel-tabula)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.2k](/packages/nilgems-laravel-textract)[rgilyov/laravel-csv-importer

Easy and reliable way to import, parse, validate and transform your csv files with laravel

166.1k](/packages/rgilyov-laravel-csv-importer)

PHPackages © 2026

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