Download the PHP package romanzipp/laravel-model-doc without Composer
On this page you can find all versions of the php package romanzipp/laravel-model-doc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download romanzipp/laravel-model-doc
More information about romanzipp/laravel-model-doc
Files in romanzipp/laravel-model-doc
Package laravel-model-doc
Short Description Laravel Model PHPDoc Generator
License MIT
Informations about the package laravel-model-doc
Laravel Model PHPDoc Generator
Generate PHPDoc comments for Laravel Models including database columns, relationships, accessors, query scopes and factories.
Contents
- Installation
- Configuration
- Features
- Testing
Installation
Configuration
Copy configuration to config folder:
Usage
See the configuration file for more specific use cases.
Prepare your models
- Add the corresponding table name
- Add relation methods return types
- Add accessor methods return types
Example
Set custom path
You can set a custom base path for the generator using the usePath
static method.
See the configuration file for more specific use cases.
Use verbose mode
If you get an error when generating the documentation for a model, you can use the --v
option to get more information about the error.
Custom database types
If (in verbose mode) you get an error like Unknown database type enum requested
, you can add that custom type mapping in Laravel's database.php
config file. Laravel uses the Doctrine DBAL package for database types. You can find a list of supported types here.
Laravel provides an example for timestamp
type mapping here.
Here is an example for enum
type mapping in database.php
config file:
Features
- [x] Generate
@property
tags from attributes - [x] Look for attributes type casts
- [x] Do not generate attribute
@property
tag if accessor exists - [x] Generate
@method
tags from relationships - [x] Generate
@property
tags from relationships - [x] Generate
@property
tags from relationship counts - [x] Generate
@method
tags query scopes - [x] Generate
@property
tags from accessors - [ ] Only generate
@property-readonly
if accessor has no real attribute or mutator
Testing
SQLite
MariaDB
Requires Lando.
All versions of laravel-model-doc with dependencies
illuminate/database Version ^11.0
illuminate/console Version ^11.0
illuminate/support Version ^11.0
phpowermove/docblock Version ^4.0