Laravel Migration’s after() method, the Better way

--

I usually encounter when I need to create a table migration where I need to add a number of columns after a specific column. Defining each column with the after() method bothers me so I came up with a quick solution to make it easy.

Before:

After:

The solution:

I created a helper function called after(). This can be also a macro if you prefer it that way.

Happy coding! :-)

--

--

No responses yet