Hi!
When you add a new column to a table using the generator, eg:
' php artisan generate:migration add_email_to_users_table --fields="email:string" '
It will be added as the last column in the table.
Is there a way to add a new column before an existing column? What would the generator command be then?
I guess it doesnt really matter - it only for your eyes.
You could do,
$table->string('email')->after('username')
great thx!
and it turned out that the commandline would look like this:
php artisan generate:migration add_email_to_users_table --fields="email:string:after('username')"
(hmm Wonder if there is a any documentation anywhere about this??)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community