Download the PHP package jeroenzwart/laravel-csv-seeder without Composer

On this page you can find all versions of the php package jeroenzwart/laravel-csv-seeder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-csv-seeder

PHP from Packagist Latest Version on Packagist GitHub code size in bytes Total Downloads Scrutinizer code quality (GitHub/Bitbucket)

Laravel CSV Seeder

Seed your database using CSV files with Laravel or Lumen

With this package you can save time for seeding your database. Instead of typing out the seeder files, you can use CSV files to fill up the database of your project. There are configuration options available to control the insert the data of your CSV files.

Features

Installation

Basic usage

Extend your seed classes with JeroenZwart\CsvSeeder\CsvSeeder and set the variable $this->file with the path of the CSV file. Tablename is not required, if the filename of the CSV is the same as the tablename. At last call parent::run() to seed. A seed class will look like this;

Place your CSV into the path /database/seeds/csvs/ of your Laravel project or whatever path you specify in the constructor. As default the given CSV require a header row with names, matching the columns names of the table in your database. Looks like this;

first_name,last_name,birthday
Foo,Bar,1970-01-01
John,Doe,1980-01-01

Configuration

Tip

Users of Microsoft Excel can use a macro to export there worksheets to CSV. Easiest is to name your worksheets as table name. Use the following macro to export;

Public Sub SaveWorksheetsAsCsv()
ActiveWorkbook.Save
Dim xWs As Worksheet
Dim xDir As String
Dim folder As FileDialog
Set folder = Application.FileDialog(msoFileDialogFolderPicker)
If folder.Show <> -1 Then Exit Sub
xDir = folder.SelectedItems(1)
For Each xWs In Application.ActiveWorkbook.Worksheets
xWs.SaveAs xDir & "\" & xWs.Name, xlCSV
Next
End Sub

Examples

Table with given timestamps

Give the seeder a specific table name instead of using the CSV filename;

Connection

Give the seeder a specific connection and table name.;

Mapping

Map the CSV headers to table columns, with the following CSV;

1,Foo,Bar
2,John,Doe

Handle like this;

Aliases with defaults

Seed a table with aliases and default values, like this;

Skipper

Skip a column in a CSV with a prefix. For example you use id in your CSV and only usable in your CSV editor. The following CSV file looks like so;

%id,first_name,last_name,%id_copy,birthday
1,Foo,Bar,1,1970-01-01
2,John,Doe,2,1980-01-01

The first and fourth value of each row will be skipped with seeding. The default prefix is '%' and changeable to;

Validate

Validate each row of a CSV like this;

Parse

Parse values of certain column when seeding a CSV like this;

Hash

Hash values when seeding a CSV like this;

License

Laravel CSV Seeder is open-sourced software licensed under the MIT license. Please see the license file for more information

Donation

If this project helped you to reduce some time to develop, you can donate me a beer :)
By Bitcoin 17jnh8oBkgLpXo3d9Xmq6i6hhYgooaYiGf or the link below;

paypal


All versions of laravel-csv-seeder with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version >=5.0
illuminate/database Version >=5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jeroenzwart/laravel-csv-seeder contains the following files

Loading the files please wait ....