Krixnaas
Posted on June 16, 2022
php artisan make:migration update_users_table --table=users
If update file already exist
php artisan make:migration add_phone_number_to_users_table --table=users
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->text('phone_number')->nullable()->after('address');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('phone_number');
});
}
💖 💪 🙅 🚩
Krixnaas
Posted on June 16, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
undefined From PHP to Go: Recognizing and Avoiding PHP-ish Patterns in Go Projects (part 2)
November 27, 2024