Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 1.63 KB

README.md

File metadata and controls

61 lines (46 loc) · 1.63 KB

Laravel table comment for migration

Latest Version on Packagist GitHub Code Style Action Status Total Downloads


Just a simple extension for commenting table in laravel migration.

Installation

You can install the package via composer:

composer require chuoke/laravel-table-comment

Usage

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
// use Illuminate\Database\Migrations\Migration;
use Chuoke\LaravelTableComment\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name', 30)->comment('Name');

            $table->comment('User info table');
        });
    }

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

License

The MIT License (MIT). Please see License File for more information.