Search code examples
laravellaravel-5laravel-migrations

How to add comment to table (not column) in Laravel 5 migration?


How to add comment to table (ot column) in Laravel 5 migration?

I currently know how to add comment to column like:

$table->tinyInteger('status')->comment('0: requested; -1: rejected; 1:confirmed');

But what about table?


Solution

  • Currently, Laravel does not allow (does not have functionality) to put comment on tables, so You have to use workaround in Your migration:

    DB::statement("ALTER TABLE `<YOUR_TABLE>` comment '<COMMENT>'");