Looking to hire Laravel developers? Try LaraJobs

laravel-database maintained by little-superman

Description
重写laravel部(database) 不部分代码
Author
Last update
2019/08/03 12:21 (dev-master)
License
Links
Downloads
3

Comments
comments powered by Disqus

重写laravel database 部分代码

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');
    }
}