wyattcast44 / laravelschema
:description
Requires
- doctrine/dbal: ^2.9|^3.0
- illuminate/support: ~7|~8
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~5.0|~6.0
- phpunit/phpunit: ^8.4
- sempro/phpunit-pretty-print: ^1.0
This package is auto-updated.
Last update: 2024-12-20 00:37:23 UTC
README
This is a simple package to generate schema files for your database tables.
For an example, the standard users
table in a new laravel application will
generate a file named users.schema.json
that contains the contents below.
{ "name": "users", "schema": { "id": "bigint", "name": "string", "email": "string", "email_verified_at": "datetime", "password": "string", "remember_token": "string", "created_at": "datetime", "updated_at": "datetime" } }
Installation
composer require wyattcast44/laravelschema
Usage
-
Schema files will be regenerated anytime you run migrations
-
You can manually trigger a build by running the command below
php artisan schema:generate
Config
You can publish the config file using the command below
php artisan vendor:publish --provider="WyattCast44\LaravelSchema\LaravelSchemaServiceProvider"
Once you have published the config file you can customize:
- Whether or not to automatically generate schema files when migrations are ran
- where the files will be generated, the default location is in
database\schemas
- the file extension, the default is
.schema.json
- you add any tables you would like to ignore
Why
This package helps you quickly and easily determine what field all your database tables have and the datatype for those fields.
As a project grows generally the number of migrations does as well, this can make it hard to determine by looking in one place what the final structure of a table is. You could open a database GUI and look there, but I wanted an easier way without leaving my code editor.
I hope you find this package useful in your workflow, I know I use it daily in mine :)
Change log
Please see the changelog for more information on what has changed recently.
Testing
composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.