Package that generates a php file with the tables and fields of the database after running all the migrations

2.0.0 2018-05-17 14:28 UTC

This package is not auto-updated.

Last update: 2021-07-24 10:47:17 UTC



You can pull in the package via composer:

    composer require nachofassini/laravel-database-structure

For laravel < 5.6: the service provider must be registered:

    // config/app.php
    'providers' => [

How to generate schema file

To generate schema file just type in the console:

    php artisan schema:file

The file should be generated at your database path like schema.php and would look like these:

    $tables => [
        'users' => [
        'posts' => [

There are no conventions about this, but I think this file should be ignored.

Automatic update on migrations

If you want the file to be updated every time you change the database through any migrate command, just set AUTOMATIC_SCHEMA_FILE=true in your .env file.

This will make that after executing any kind of migration command, the schema file gets up to date with the final database structure.


I think this can be much more useful, any collaboration is appreciated.


The MIT License (MIT). Please see License File for more information.