little-superman/laravel-database

重写laravel部(database) 不部分代码

v0.0.2 2019-06-28 13:33 UTC

This package is auto-updated.

Last update: 2024-10-29 05:40:50 UTC


README

1. 扩展迁移表备注

安装

composer require little-superman/laravel-database

命令行

php artisan customize:migration 表名称

使用

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use LittleSuperman\Database\Facades\SchemaExtends;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        SchemaExtends::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            
            $table->tableComment('表备注');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user');
    }
}