2017 © Pedro PelĂĄez
 

library laravel-mysql-to-seeder

MySQL to Laravel >5.1 Seeder

image

schwarzer/laravel-mysql-to-seeder

MySQL to Laravel >5.1 Seeder

  • Thursday, May 12, 2016
  • by Schwarzer IT
  • Repository
  • 2 Watchers
  • 8 Stars
  • 1,627 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 5 Versions
  • 14 % Grown

The README.md

MySQL to Laravel Seeder

Packagist Packagist Packagist, (*1)

I was in need of a tool to export Data from an existing MySQL DB to a Laravel Seeder. I searched online for it, but found not the right tool I wanted. I stumbled upon the namelivia/mysql-to-laravel-seed., (*2)

But it ... - ... used outdated functions - ... forced me to create a export schema - ... didn't create working Seeders (missing use Illuminate\Database\Seeder;) - and the Seeders didn't look nice, (*3)

I decided to create my own version of a MySQL to Laravel Seeder Tool., (*4)

works with

PHP Version MySQL Version
5.6.17 5.6.25
5.6.17 5.7.10
7.0.2 5.6.25
7.0.2 5.7.10

I welcome all notifications about working environments. Just mail me (info@schwarzer.it) and I'll put it up here, or send a merge request., (*5)

Simple Examples

Create a file named export.php in your Laravel root (where your .env is) and execute it by using php ./export.php . Done., (*6)

Use without Composer autoload


<?php require_once __DIR__.'/path/to/schwarzer/laravel-mysql-to-seeder/src/Export.php'; $export = new \Schwarzer\LaravelHelper\MySQLToSeeder\Export('hostname','database','username','password',3306); $export->generateExport( null, // null equals "All Tables" ( $this->getAllTableNames() ) './database/seeds', // if null './database/seeds' is applied ['these','are','boolean','values'], ['timestamp_column','created_at', 'updated_at'], ['type','date'] );

Use with Composer autoload


<?php require __DIR__.'/vendor/autoload.php'; $export = new \Schwarzer\LaravelHelper\MySQLToSeeder\Export('hostname','database','username','password',3306); $export->generateExport( null, // null equals "All Tables" ( $this->getAllTableNames() ) './database/seeds', // if null './database/seeds' is applied ['these','are','boolean','values'], ['timestamp_column','created_at', 'updated_at'], ['type','date'] );

The Versions

12/05 2016

dev-master

9999999-dev

MySQL to Laravel >5.1 Seeder

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

laravel mysql seeder

01/02 2016

v0.9.2

0.9.2.0

MySQL to Laravel >5.1 Seeder

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

laravel mysql seeder

01/02 2016

v0.9.1

0.9.1.0

MySQL to Laravel >5.1 Seeder

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

laravel mysql seeder

01/02 2016

v0.9

0.9.0.0

MySQL to Laravel >5.1 Seeder

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

laravel mysql seeder

01/02 2016

v0.1.1

0.1.1.0

MySQL to Laravel >5.1 Seeder

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

laravel mysql seeder