laravel 表 添加注释

https://packagist.org/packages/zedisdog/laravel-schema-extend


找到 

/zedisdog/laravel-schema-extend

Composer 

composer require zedisdog/laravel-schema-extend


使用前的准备

在 composer.json 文件中申明依赖:

  • support laravel 5.*
"zedisdog/laravel-schema-extend": "~0.5"

在配置文件 config/app.php 中替换“别名”

'aliases' => array(
    ...
    // 'Schema' => Illuminate\Support\Facades\Schema::class,
    'Schema'    => zedisdog\LaravelSchemaExtend\Schema::class,
),

使用方法

Schema::create('tests', function ($table) {
    $table->increments('id')->comment('列注释');
    $table->comment = '表注释';
});

你可能感兴趣的:(laravel)