1

I've noticed that there are other questions on Stack Exchange about how to add columns into a DB Table (for example, here), but none of them address how to add a column into the table so that it is the FIRST column in the table.

I've seen that you can add ->after('column_name') to add the column after another column within the table, but is there a "->before('column_name')" that I could use (or some sort of smarter equivalent)?

Community
  • 1
  • 1
alexandersix
  • 55
  • 2
  • 6

1 Answers1

0

Well, as luck would have it, I jumped the gun a bit with my question and managed to find my own answer.

In Laravel 5.1, you can use the column modifier ->first() in order to place the column first in the table.

alexandersix
  • 55
  • 2
  • 6