I want to add new Column with Migration after a custom column, for example I have this table structure:
And now I need to add a new column named badge
after the prd_description
(column 14).
So I ran php artisan make:migration add_badge_to_products_table --table=products
And here it goes:
public function up()
{
Schema::table('products', function (Blueprint $table) {
$table->tinyInteger('badge')->unsigned()->nullable();
});
}
But now the problem is, I don't know how to add this column after that particular column. Because by default, Laravel adds this at the end of table.
So how to do this?