Download the PHP package triquang/laravel-model-doc without Composer
On this page you can find all versions of the php package triquang/laravel-model-doc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-model-doc
Laravel Model Doc Generator
A Laravel Artisan command that generates PHPDoc blocks for your Eloquent models based on your database schema and relationships.
Example:
๐ Features
- Generate
@propertybased on SQL column types. - Detect
@property-readfrom relationships. - Support models in:
app/ModelsModules/*/app/Models(modular structure)
- Sort by:
- PHP type (default)
- Property name
- DB type
- Supports multiple DB drivers: MySQL, PostgreSQL, SQLite, SQL Server, Oracle.
๐ฆ Installation
This package is intended for development only.
Please install it using the --dev flag:
Install via Composer:
โ๏ธ Usage
Run the Artisan command:
Options
| Option | Description |
|---|---|
--model |
Only process a specific model (FQCN). Example: App\\Models\\User. |
--dry-run |
Show output to screen without modifying files. |
--sort |
Sort by: type (PHP type), name, or db (PHP + DB + name). |
--ns |
Select namespaces to scan. Example: Modules\\Domain\\Models. |
๐ง How It Works
- Reads model classes from
app/ModelsandModules/*/app/Modelsor from namespaces - Uses DB schema to map SQL types โ PHP types
- Detects Eloquent relationships (e.g.,
hasMany,belongsTo) - Writes
/** ... */docblock directly under<?phpin model file
๐งช Examples
Generate all model docs:
Dry-run mode (preview only):
Generate for a specific model:
Scan custom namespaces only:
๐ก Note: Namespaces must be mapped in
composer.jsonusingpsr-4autoloading. This also applies toModules/*/composer.json.
๐ Example Output
โ Requirements
- PHP >= 8.0
- Laravel 11 / 12
- Composer
๐ License
MIT ยฉ Nguyแป n Trรญ Quang
๐ Contributing
PRs are welcome! Feel free to improve functionality or report issues via GitHub Issues.
๐ฌ Contact
- GitHub: github.com/ntquangkk
- Email: [email protected]
All versions of laravel-model-doc with dependencies
PHP Build Version
Package Version
The package triquang/laravel-model-doc contains the following files
Loading the files please wait ...