2017 © Pedro Peláez
 

project laravel-schema

The Laravel schema package.

image

autn/laravel-schema

The Laravel schema package.

  • Monday, November 13, 2017
  • by autn
  • Repository
  • 1 Watchers
  • 5 Stars
  • 2,553 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 13 Versions
  • 4 % Grown

The README.md

Laravel Database Schema

Latest Version on Packagist Build Status Total Downloads, (*1)

1. About

This package generate Mysql database schema from migrations files., (*2)

Update Sep 2020: Now support latest Laravel version, (*3)

2. Installation

Install via composer - edit your composer.json to require the package., (*4)

"require": {
    // ...
    "autn/laravel-schema": "*"
}

Then run composer update in your terminal to pull it in. Once this has finished, you will need to add the command to the commands array in your app/Console/Kernel.php config as follows:, (*5)

// ....
protected $commands = [
    // ...
    'db:schema' => \Autn\Schema\Console\Commands\DumpSql::class,
];
// ...

3. Usage

Notice: The command will refresh your database, the seeding and actual datas will remove. I recommend use --dbconnect to run with other database., (*6)

In root Laravel project, type:, (*7)

php artisan db:schema

The file will generate to the default databases path (database/schema.sql)., (*8)

You can change this path by add --path option to the command., (*9)

Example:, (*10)

php artisan db:schema --path=public

The default database connect is mysql in config/database.php. You can change the connect by add --dbconnect to the command., (*11)

Example:, (*12)

php artisan db:schema --path=public --dbconnect=mysql2

Notice: If you add --dbconnect option, you must add config to config/database.php., (*13)

Example:, (*14)

// ....
'mysql' => [
    'driver' => 'mysql',
    'host' => env('DB_HOST', 'localhost'),
    'port' => env('DB_PORT', '3306'),
    'database' => env('DB_DATABASE', 'db'),
    'username' => env('DB_USERNAME', 'root'),
    'password' => env('DB_PASSWORD', 'root'),
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',
    'strict' => false,
    'engine' => null,
],

'mysql2' => [
    'driver' => 'mysql',
    'host' => 'localhost',
    'port' => '3306',
    'database' => 'db2',
    'username' => 'root',
    'password' => 'root',
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',
    'strict' => false,
    'engine' => null,
],
// ...

There are full options:, (*15)

--path=: Path to save schema file

--dbconnect=: Database connect to run

--force: Run without confirmation

--method=: Name of method (mysqldump/php). If your server not install mysql (remote to other database server), you must select `php` method

--refresh=: Public migration files and refresh migrations (yes/no)

--type=: Type of file (sql/gzip/bzip2)

4. Changelog

  • Version 1.x
Supported mysqldump method
  • Version 2.0.x
Supported php method (mysqldump version php)
  • Version 2.1.x
Supported compress (type option)
  • Version 3.x
Update to support latest Laravel version

The Versions

13/11 2017

dev-master

9999999-dev

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

08/08 2016

dev-develop

dev-develop

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

08/08 2016

v2.1.1

2.1.1.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

07/07 2016

v2.1.0

2.1.0.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

23/06 2016

v2.0.1

2.0.1.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

21/06 2016

v2.0

2.0.0.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

18/05 2016

v1.3

1.3.0.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

18/05 2016

v1.2.1

1.2.1.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

17/05 2016

v1.1.1

1.1.1.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

17/05 2016

v1.2

1.2.0.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

11/05 2016

v1.1

1.1.0.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

11/05 2016

v1.0.3

1.0.3.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema

11/05 2016

v1.0.2

1.0.2.0

The Laravel schema package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Au Truong Ngoc

database laravel framework schema