mileschou / schemarkdown
The schema generate helper
Requires
- php: ^8.0
- doctrine/dbal: ^2.6
- illuminate/console: ^8 | ^9 | ^10 | ^11
- illuminate/database: ^8 | ^9 | ^10 | ^11
- illuminate/events: ^8 | ^9 | ^10 | ^11
- illuminate/support: ^8 | ^9 | ^10 | ^11
- illuminate/view: ^8 | ^9 | ^10 | ^11
- mikey179/vfsstream: ^1.6.7
- mileschou/codegener: ^2.0
Requires (Dev)
- ext-pdo: *
- illuminate/container: ^8 | ^9 | ^10 | ^11
- laravel-zero/framework: ^8.10 | ^9 | ^10 | ^11
- pestphp/pest: ^1.22
- phpunit/phpunit: ^9.6
- psy/psysh: ^0.11.15
- squizlabs/php_codesniffer: ^3.10.2
- symfony/var-dumper: ^6
This package is auto-updated.
Last update: 2024-11-03 03:16:36 UTC
README
The core library for generate Markdown document and Laravel Eloquent Model classes from database schema.
Installation
Use Composer to install:
composer require mileschou/schemarkdown
Usage
Use following command to generate schema documents:
cd /path/to/your-laravel-project
php artisan schema:markdown
Schema document are stored to docs/schema
directory default. Use the --path
option to change it.
In the other framework, you must provide config file like Laravel. Use --config
option to specify customize configuration.
This tool will load .env
before load config. Use the --env
option to specify .env path.
Use the --database
option to specify connection name in Laravel config to generate the document of one database.
Use the --overwrite
option if you want to overwrite the exists document.
Use following command to generate eloquent models:
cd /path/to/your-laravel-project
php artisan schema:model
It's will generate model code into app/Models
directory (Laravel 8 default), use the --path
option can change output dir. If want to change namespace, use the --namespace
option.
In the other framework but using Eloquent ORM library, you must provide config file like laravel project. Use --config
option to specify customize configuration.
If only want build one connection, use the --database
option to specify.
Use the --overwrite
option if you want to overwrite exist code.
Example
Here is example SQL, import MySQL and run following command:
php artisan schemarkdown --config=tests/Fixtures/database.php --database=examples --output-dir=examples
It will generate this Markdown documents.
Troubleshooting
Use -vv
option to see info log.
License
The MIT License (MIT). Please see License File for more information.