//exemple :
//php artisan make:migration add_new_column_to_my_table_table --table=my_table
//php artisan make:migration add_login_to_users_table --table=users
public function up()
{
Schema::table('my_table', function($table) {
$table->integer('new_column')->after('other_column_name');
//with after it's better to place it in your table
});
}
public function down()
{
Schema::table('my_table', function($table) {
$table->dropColumn('new_column');
});
}
php artisan make:migration add_paid_to_users_table --table=users
public function up()
{
Schema::table('users', function($table) {
$table->integer('paid');
});
}
and don't forget to add the rollback option:
public function down()
{
Schema::table('users', function($table) {
$table->dropColumn('paid');
});
}