Download the PHP package bauerdot/laravel-dbml without Composer
On this page you can find all versions of the php package bauerdot/laravel-dbml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-dbml
CURRENTLY PUBLISHED AS TEST PACKAGE!
Laravel DBML
Install
composer require bauerdot/laravel-dbml
Usage
- For listing all tables in database:
php artisan dbml:list
(custom type --custom) - For Parse from DB to DBML:
php artisan dbml:parse
(see options below)
Available Options
Table Filtering and Ignore Presets
System Tables
By default, Laravel system tables are ignored. You can include them with the --include-system
flag:
Ignore Presets
The package comes with predefined groups of tables (presets) that can be ignored:
- system: Laravel's core tables (migrations, jobs, cache, etc.)
- spatie-permissions: Tables from the Spatie Laravel-Permission package
- telescope: Laravel Telescope tables
You can specify which presets to use:
Include All Tables
If you want to include all tables with no filtering, use the --no-ignore
flag:
Configuration File
You can specify a custom configuration file with the --config
option:
The config file can be in JSON, PHP, or YAML format and supports the following options:
Available Configuration Options
Option | Type | Default | Description |
---|---|---|---|
ignore_by_default |
boolean | true | Whether to ignore tables by default |
ignore_presets |
array | system, spatie-permissions, telescope | Predefined groups of tables to ignore |
active_presets |
array | ['system'] | Presets that are active by default |
ignored_tables |
array | [] | Additional tables to always ignore |
document_casts |
boolean | true | Whether to document Laravel cast attributes |
document_cast_types |
array | json, array, etc. | Which cast types to document |
document_spatie_data |
boolean | true | Whether to document Spatie Data objects |
inline_schema |
boolean | true | Put schema in column-level notes instead of table notes |
spatie_data_namespace |
string | App\ValueObjects | Namespace for your Spatie Data objects |
only_tables |
array | [] | Only process these tables (supports wildcards) |
models_dir |
string | app/Models | Directory where your Laravel models are located |
Publishing the Configuration
You can publish the package configuration file with:
Parsing Specific Tables Only
You can use the --only
option to specify which tables should be included in the DBML output:
Column-Level Schema Documentation
This package adds schema information directly to column definitions, making it easier to understand complex data structures:
Laravel Model Cast Documentation
This package can automatically detect Laravel model cast attributes and document their structure in the DBML output. This is especially useful for JSON columns where the structure is defined in the model.
To document the JSON structure in your models, add a @json-structure
tag to your property or accessor method:
Spatie Data Object Support
The package can analyze Spatie Data objects used in Laravel model casts and document their structure. For example, with a model like this:
And a Spatie Data object like this:
The DBML output will include the structure:
Customizable Type
- Store file in /storage/app/custom_type.json
- Example
- { "type": "target_type" }
Credits
- Arsanandha Aphisitworachorch - Original author
- bauerdot - Fork maintainer
- All Contributors
Security
If you discover any security-related issues, please open an issue or pull request.
License
The MIT License (MIT). Please see License File for more information.
For developers
- you need to use the package in you project for developemtn you need already existing project and then add this to composer .json
and then run
- since this package has no laravel instalation you need therefore to have it
- no need for autodiscovery this package has it already inside