Support the ongoing development of Laravel.io →
posted 6 years ago

I have a column as tinyInteger. Now I would like to add comment to the column with new migration file.

Schema::table('sales_invoices', function (Blueprint $table) { 

$table->tinyInteger('invoice_type')->comment('0 > A Normal Invoice, 1 > A Recurring Invoice'); 

});

Now above is the code I am trying in new schema to add comment, but it doesn't work and gives error.

Last updated 3 years ago.
0
moderator Solution

If you want to change a column (and adding a comment to a column is also a change) you need to add the ->change() call on the end. And be sure you have the required package doctrine/dbal.

See: https://laravel.com/docs/5.7/migrations#modifying-columns

0

Thank you for your comment :)

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

rijans rijans Joined 6 Mar 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.