Answer: Laravel 5.2 migration comment on column in migration

rnagarajan96

Nagarajan R

Posted on September 15, 2020

Answer: Laravel 5.2 migration comment on column in migration

You can use comment() method along with change()

Schema::table('users', function(Blueprint $table) {
    $table->string('name')->comment('Name of the user')->change();
});

To make sure it migrated properly

mysql> show full columns from users like 'name';
+-------+--------------+--------------------+------+-----+---------+-------+---------------------------------+------------------+
| Field | Type         | Collation          | Null | Key | Default | Extra | Privileges                      | Comment
💖 💪 🙅 🚩
rnagarajan96
Nagarajan R

Posted on September 15, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related