qsun/model-annotation

This package is abandoned and no longer maintained. No replacement package was suggested.

Installs: 11 721

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 3

Forks: 7

Open Issues: 3

pkg:composer/qsun/model-annotation

dev-master 2020-02-17 21:29 UTC

This package is auto-updated.

Last update: 2022-01-18 01:54:06 UTC


README

ModelAnnotation puts database schema aside with your model files for easy reference.

Add annotation to plain Laravel model files

<?php
/* MODEL ANNOTATION:
@property	$id                      Type: bigint(20) unsigned      Extra: auto_increment      Default: null      Key: PRI
@property	$name                    Type: varchar(255)             Extra:                     Default: null      Key: nil
@property	$email                   Type: varchar(255)             Extra:                     Default: null      Key: UNI
@property	$email_verified_at       Type: timestamp                Extra:                     Default: null      Key: nil
@property	$password                Type: varchar(255)             Extra:                     Default: null      Key: nil
@property	$remember_token          Type: varchar(100)             Extra:                     Default: null      Key: nil
@property	$created_at              Type: timestamp                Extra:                     Default: null      Key: nil
@property	$updated_at              Type: timestamp                Extra:                     Default: null      Key: nil

END MODEL ANNOTATION */

namespace App;

use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    /**

Usage

This package only works with MySQL for now.

  • Make sure you have backup or VCS.

  • Modify composer.json file, include following line for require section:

"require": {
    ...
    "qsun/model-annotation": "dev-master"
}
  • Run composer update to install newly added package

  • Add Service Provider in app.php:

'providers' => [
    ....
    qsun\ModelAnnotation\AnnotationServiceProvider::class
]
  • Run php artisan annotate:models to annotate model files