How to add is_activated column in database using laravel migration

Created at 06-Dec-2024 , By samar

public function up(): void
{
  Schema::table('users', function (Blueprint $table) {
  	$table->boolean('is_activated')->default(false)->comment('false for not active users and true for active users');
  });
}

/**
* Reverse the migrations.
*/
public function down(): void
{
  Schema::table('users', function (Blueprint $table) {
  	$table->dropColumn('is_activated');
  });
}

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.