chuoke/laravel-table-comment

Laravel table comment for migration

1.0.1 2021-07-14 01:22 UTC

This package is auto-updated.

Last update: 2024-11-14 08:16:14 UTC


README

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.