From 34319e5724d31271610cad68a894216fe3a256a5 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Wed, 28 Jun 2023 23:44:06 +0600 Subject: [PATCH] Additional fields 'is_active' and 'timezone' have been added to the users table in the database migrations and the User model. This update allows us to better manage user's activation status and time zone preferences. 'is_active' field, a boolean field, signifies the active status of a user and has been set to default to false. 'timezone', an optional string, will store user's preferred timezone. --- app/Models/User.php | 3 +++ database/migrations/2014_10_12_000000_create_users_table.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/app/Models/User.php b/app/Models/User.php index 7305dc7..b1843b9 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -22,6 +22,8 @@ class User extends Authenticatable 'name', 'email', 'password', + 'timezone', + 'is_active', ]; /** @@ -41,5 +43,6 @@ class User extends Authenticatable */ protected $casts = [ 'email_verified_at' => 'datetime', + 'is_active' => 'boolean' ]; } diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 76d2754..8b37449 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -13,11 +13,13 @@ return new class extends Migration { Schema::create('users', function (Blueprint $table) { $table->id(); + $table->boolean('is_active')->default(0)->index(); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->rememberToken(); + $table->string('timezone')->nullable(); $table->timestamps(); $table->softDeletes(); });